Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * Written (W) 2012 Heiko Strathmann
- */
- #ifndef __STREAMINGDENSEDATAGENERATOR_H_
- #define __STREAMINGDENSEDATAGENERATOR_H_
- #include <shogun/features/streaming/StreamingDenseFeatures.h>
- namespace shogun
- {
- enum EDenseDataGenerator
- {
- DGD_NONE, DGD_MEAN_SHIFT, DGD_ROT_SYM_GAUSS
- };
- /** @brief
- * Class to generate dense features data via the streaming features interface.
- * The core are pairs of methods to
- * a) set the data model and parameters, and
- * b) to generate a data vector using these model parameters
- * Both methods are automatically called when calling get_next_example()
- * This allows to treat generated data as a stream via the standard streaming
- * features interface
- */
- template <class T>
- class CStreamingDenseDataGenerator: public CStreamingDenseFeatures<T>
- {
- public:
- /** Constructor */
- CStreamingDenseDataGenerator();
- /** Destructor */
- virtual ~CStreamingDenseDataGenerator();
- /** @return name of SG_SERIALIZABLE */
- inline virtual const char* get_name() const
- {
- return "StreamingDenseDataGenerator";
- }
- void set_mean_shift_model(T mean_shift, index_t dim);
- /** Takes a sample from two a distribution where each element
- * is standard normally distributed, except for the first dimension,
- * where the mean is shifted by a specified value.
- *
- * @param dim dimension of generated samples
- * @param mean_shift is added to mean of first dimension
- * @return dimx1 vector with sample
- */
- static SGVector<T> generate_mean_shift_data(index_t dim, T mean_shift);
- bool get_next_example();
- private:
- /** registers all parameters and initializes variables with defaults */
- void init();
- protected:
- /** model of data to generate */
- EDenseDataGenerator m_model;
- /** parameters of model */
- Parameter* m_model_parameters;
- };
- }
- #endif /* __STREAMINGDENSEDATAGENERATOR_H_ */
Add Comment
Please, Sign In to add comment