Skip to content

Instantly share code, notes, and snippets.

@geektoni
Last active May 16, 2017 08:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save geektoni/8f9fec7226a3ca87d519818a97f6c7d4 to your computer and use it in GitHub Desktop.
Save geektoni/8f9fec7226a3ca87d519818a97f6c7d4 to your computer and use it in GitHub Desktop.
#ifndef __SGOBJECT_H__
#define __SGOBJECT_H__
#include <shogun/lib/config.h>
#include <shogun/lib/common.h>
#include <shogun/lib/DataType.h>
#include <shogun/lib/ShogunException.h>
#include <shogun/base/Version.h>
#include <shogun/base/unique.h>
#include <shogun/io/SGIO.h>
#include <shogun/lib/tag.h>
#include <shogun/lib/any.h>
#include <shogun/lib/some.h>
/** \namespace shogun
* @brief all of classes and functions are contained in the shogun namespace
*/
namespace shogun
{
class RefCount;
class SGIO;
class Parallel;
class Parameter;
class CSerializableFile;
class CSGObject
{
public:
/** default constructor */
CSGObject();
/** copy constructor */
CSGObject(const CSGObject& orig);
/** destructor */
virtual ~CSGObject();
virtual Some<CSGObject> shallow_copy() const;
virtual Some<CSGObject> deep_copy() const;
virtual const char* get_name() const = 0;
void set_global_io(Some<SGIO> io);
Some<SGIO> get_global_io();
void set_global_parallel(Some<Parallel> parallel);
Some<Parallel> get_global_parallel();
void set_global_version(Some<Version> version);
Some<Version> get_global_version();
public:
virtual bool equals(const Some<CSGObject> other, float64_t accuracy=0.0, bool tolerant=false);
virtual Some<CSGObject> clone();
public:
/** io */
Some<SGIO> io;
/** parallel */
Some<Parallel> parallel;
/** version */
Some<Version> version;
/** parameters */
Some<Parameter> m_parameters;
/** model selection parameters */
Some<Parameter> m_model_selection_parameters;
/** parameters wrt which we can compute gradients */
Some<Parameter> m_gradient_parameters;
/** Hash of parameter values*/
uint32_t m_hash;
private:
EPrimitiveType m_generic;
bool m_load_pre_called;
bool m_load_post_called;
bool m_save_pre_called;
bool m_save_post_called;
};
}
#endif // __SGOBJECT_H__
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment