![]() |
ImFusion SDK 4.3
|
#include <ImFusion/ML/DataLoaders/RepeatDataLoader.h>
Repeats items coming from a nested loader. More...
Inheritance diagram for RepeatDataLoader:Repeats items coming from a nested loader.
Repetition can either by per epoch (i.e. the entire epoch of the nested data loader is repeated) or per item (i.e. each item is repeated a certain number of times) or both.
Public Member Functions | |
| RepeatDataLoader (std::unique_ptr< DataLoader > loader, int numEpochRepetitions=-1, int numItemRepetitions=1, bool verbose=false) | |
| RepeatDataLoader (DataLoaderList dataLoaders, const Properties &prop) | |
| 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. | |
| void | reset () override |
| Reset the loader in order to restart the iteration. | |
| void | configure (const Properties *properties) override |
| Configure this object instance by de-serializing the given Properties. | |
Public Member Functions inherited from 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. | |
| virtual void | reinit () |
| Reinitialize the loader state, cleaning it up if necessary Overload this method if your loader has state that must survive reset (i.e. | |
| virtual Cardinality | cardinality () const |
| Cardinality of this specific loader node. | |
| 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) |
| virtual Status | canBePrefetched () const |
| Indicates whether a loader is eligible for prefetching. | |
| const std::string & | logDomain () const |
| Log domain for AdvancedParameter. | |
Public Member Functions inherited from 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 |
Public Member Functions inherited from SignalReceiver | |
| SignalReceiver ()=default | |
| Default constructor. | |
| SignalReceiver (const SignalReceiver &other) | |
| Copy constructor, does not copy any existing signal connections from other. | |
| SignalReceiver & | operator= (SignalReceiver rhs) |
| Assignment operator, disconnects all existing connections, does not copy any existing signal connections from rhs. | |
| virtual | ~SignalReceiver () |
| Virtual destructor disconnects from all connected signals. | |
Public Attributes | |
| LoaderParam< int > | m_numEpochRepetitions = {"num_epoch_repetitions", -1, this, ParamRequired::Yes, "num_epochs"} |
| LoaderParam< int > | m_numItemRepetitions = {"num_item_repetitions", 1, this, ParamRequired::No} |
Public Attributes inherited from DataLoader | |
| LoaderParam< bool > | m_verbose = {"verbose", false, this, ParamRequired::No} |
| If enabled, print log messages with extra information like timings. | |
Public Attributes inherited from Configurable | |
| Signal | signalParametersChanged |
Emitted whenever one of the registered Parameters' or SubPropertys' signalValueChanged signal was emitted. | |
Additional Inherited Members | |
Protected Member Functions inherited from NotCopyable | |
| NotCopyable (NotCopyable &&) noexcept=default | |
| NotCopyable & | operator= (NotCopyable &&) noexcept=default |
| NotCopyable (const NotCopyable &)=delete | |
| NotCopyable & | operator= (const NotCopyable &)=delete |
Protected Member Functions inherited from SignalReceiver | |
| void | disconnectAll () |
| Disconnects all existing connections. | |
Protected Attributes inherited from DataLoader | |
| std::string | m_name |
| Cardinality | m_cardinality = Cardinality::Fixed |
| Random::Generator | m_randGenerator |
| DataLoaderList | m_dataLoaders |
Protected Attributes inherited from 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 DataLoader.
|
overridevirtual |
Size of the loader, has value only for fixed cardinalities.
Implements DataLoader.
|
overridevirtual |
Reset the loader in order to restart the iteration.
Reimplemented from DataLoader.
|
overridevirtual |
Configure this object instance by de-serializing the given Properties.
The default implementation will do so automatically for all registered Parameter and SubProperty instances.
Reimplemented from DataLoader.