![]() |
ImFusion C++ SDK 4.5.0
|
#include <ImFusion/ML/DataReaders/DataListReader.h>
DataReader to directly read data from a given datalist where each column corresponds to a (single) field of the DataItem. More...
DataReader to directly read data from a given datalist where each column corresponds to a (single) field of the DataItem.
Uses FileReader::load internally, but does not require the user to specify the mapping of the datalist to the DataItem fields per entry. A DataListReader can be configured as follows:
path: single-path-to-datalist.txt
mapping: -> These refer to *columns of the datalist*
0: ct
1: label
Classes | |
| struct | LoadedInfo |
Public Types | |
| using | FileList = std::vector<Filesystem::Path> |
Public Member Functions | |
| DataListReader (const std::string &dataListPath, bool shuffle=false, std::optional< KeyMapping > mapping=std::nullopt) | |
| constructor for DataLoaderDecoratorFactory | |
| DataListReader (const Properties &properties) | |
| std::optional< DataItem > | next () override |
| Advance the loader by one iteration. | |
| std::optional< size_t > | size () const override |
| Size of the loader, has value only for fixed cardinalities. | |
| Cardinality | cardinality () const override |
| Cardinality of this specific loader node. | |
| LoadedInfo | readDatalist () |
| Public Member Functions inherited from ImFusion::ML::DataReader | |
| DataReader (std::string name="", bool verbose=false) | |
| Cardinality | cardinality () const override |
| Readers have fixed cardinality. | |
| Public Member Functions inherited from ImFusion::ML::DataLoader | |
| DataLoader (std::string name, bool verbose=false) | |
| Constructor to be used by DataReaders, as they are the first elements in the chain. | |
| DataLoader (std::string name, std::unique_ptr< DataLoader > loader, bool verbose=false) | |
| Constructor to be used by all other derived DataLoaders. | |
| DataLoader (std::string name, DataLoaderList &&dataLoaders, bool verbose=false) | |
| Constructor to be used by all other derived DataLoaders. | |
| const std::string & | name () const |
| Name of the loader. | |
| DataLoader * | singleUnderlyingLoader () const |
| Return a single underlying dataloader Expects there to be only one, returns a nullptr otherwise. | |
| std::unique_ptr< DataLoader > | extractDataloader () |
| Return a single underlying dataloader Expects there to be only one, throws an exception otherwise. | |
| DataLoaderList & | loaders () |
| DataLoaderList const & | loaders () const |
| bool | verbose () const |
| virtual void | setRandomSeed (unsigned int seed) |
| void | configure (const Properties *properties) override |
| Configure this object instance by de-serializing the given Properties. | |
| const std::string & | logDomain () const |
| Log domain for AdvancedParameter. | |
| Public Member Functions inherited from ImFusion::Configurable | |
| virtual void | configuration (Properties *p) const |
| Serialize the current object configuration into the given Properties object. | |
| virtual void | configureDefaults () |
| Retrieve the properties of this object, replaces values with their defaults and sets it again. | |
| void | registerParameter (ParameterBase *param) |
| Register the given Parameter or SubProperty, so that it will be configured during configure()/configuration(). | |
| void | unregisterParameter (const ParameterBase *param) |
| Remove the given Parameter or SubProperty from the list of registered parameters. | |
| Configurable (const Configurable &rhs) | |
| Configurable (Configurable &&rhs) noexcept | |
| Configurable & | operator= (const Configurable &) |
| Configurable & | operator= (Configurable &&) noexcept |
Protected Member Functions | |
| void | reset () final |
| Reset the loader in order to restart the iteration. | |
| void | configure (const Properties *properties) final |
| Configure this with: path: single-path-to-datalist.txt mapping: -> These refer to columns of the datalist 0: ct 1: label. | |
| void | reinit () final |
| Reinitialize the loader state, cleaning it up if necessary Overload this method if your loader has state that must survive reset (i.e. | |
| Protected Member Functions inherited from ImFusion::Utils::NotCopyable | |
| NotCopyable (NotCopyable &&) noexcept=default | |
| NotCopyable & | operator= (NotCopyable &&) noexcept=default |
| NotCopyable (const NotCopyable &)=delete | |
| NotCopyable & | operator= (const NotCopyable &)=delete |
Additional Inherited Members | |
| Public Attributes inherited from ImFusion::ML::DataLoader | |
| LoaderParam< bool > | m_verbose = {"verbose", false, this, ParamRequired::No} |
| If enabled, print log messages with extra information like timings. | |
| Public Attributes inherited from ImFusion::Configurable | |
| Signal | signalParametersChanged |
| Emitted whenever one of the registered Parameters' or SubPropertys' signalValueChanged signal was emitted. | |
| Protected Attributes inherited from ImFusion::ML::DataLoader | |
| std::string | m_name |
| Cardinality | m_cardinality = Cardinality::Fixed |
| Random::Generator | m_randGenerator |
| DataLoaderList | m_dataLoaders |
| Protected Attributes inherited from ImFusion::Configurable | |
| std::vector< Param > | m_params |
| List of all registered Parameter and SubProperty instances. | |
|
overridevirtual |
Advance the loader by one iteration.
The function must pull an item from the underlying node, process it and return it. If the underlyng loader is exhausted, returns an empty optional.
Implements ImFusion::ML::DataLoader.
|
overridevirtual |
Size of the loader, has value only for fixed cardinalities.
Implements ImFusion::ML::DataLoader.
|
overridevirtual |
Cardinality of this specific loader node.
Reimplemented from ImFusion::ML::DataLoader.
|
finalprotectedvirtual |
Reset the loader in order to restart the iteration.
Reimplemented from ImFusion::ML::DataLoader.
|
finalprotectedvirtual |
Configure this with: path: single-path-to-datalist.txt mapping: -> These refer to columns of the datalist 0: ct 1: label.
Reimplemented from ImFusion::Configurable.
|
finalprotectedvirtual |
Reinitialize the loader state, cleaning it up if necessary Overload this method if your loader has state that must survive reset (i.e.
the loader holding a cache)
Reimplemented from ImFusion::ML::DataLoader.