6 #ifndef TURI_UNITY_ML_MODEL_HPP 7 #define TURI_UNITY_ML_MODEL_HPP 9 #include <model_server/lib/variant.hpp> 10 #include <model_server/lib/unity_base_types.hpp> 11 #include <model_server/lib/toolkit_util.hpp> 12 #include <model_server/lib/toolkit_function_specification.hpp> 13 #include <model_server/lib/toolkit_class_macros.hpp> 15 #include <model_server/lib/extensions/model_base.hpp> 16 #include <model_server/lib/extensions/option_manager.hpp> 18 #include <core/export.hpp> 68 static constexpr
size_t ML_MODEL_BASE_VERSION = 0;
80 virtual void init_options(
const std::map<std::string,flexible_type>& _options) {};
100 std::vector<std::string> list_fields();
116 const variant_type& get_value_from_state(std::string key);
128 const std::map<std::string, flexible_type>& get_current_options()
const;
139 std::map<std::string, flexible_type> get_default_options()
const;
147 const flexible_type& get_option_value(
const std::string& name)
const;
154 const std::map<std::string, variant_type>& get_state()
const;
161 bool is_trained()
const;
172 void set_options(
const std::map<std::string, flexible_type>& _options);
179 void add_or_update_state(
const std::map<std::string, variant_type>& dict);
184 const std::vector<option_handling::option_info>& get_option_info()
const;
206 std::map<std::string, variant_type>
state;
212 namespace ml_model_sdk {
217 std::vector<toolkit_function_specification> get_toolkit_function_registration();
224 std::map<std::string, variant_type> _toolkits_get_default_options(
225 std::string model_name);
#define REGISTER_CLASS_MEMBER_FUNCTION(function,...)
#define BEGIN_BASE_CLASS_MEMBER_REGISTRATION()
std::map< std::string, variant_type > state
virtual void init_options(const std::map< std::string, flexible_type > &_options)
#define IMPORT_BASE_CLASS_REGISTRATION(base_class)
boost::make_recursive_variant< flexible_type, std::shared_ptr< unity_sgraph_base >, dataframe_t, std::shared_ptr< model_base >, std::shared_ptr< unity_sframe_base >, std::shared_ptr< unity_sarray_base >, std::map< std::string, boost::recursive_variant_ >, std::vector< boost::recursive_variant_ >, boost::recursive_wrapper< function_closure_info > >::type variant_type
#define END_CLASS_MEMBER_REGISTRATION
const variant_type & get_value_from_state(std::string key)
std::vector< std::string > list_fields()
#define REGISTER_NAMED_CLASS_MEMBER_FUNCTION(name, function,...)
const flexible_type & get_option_value(const std::string &name) const
const std::map< std::string, variant_type > & get_state() const
std::map< std::string, flexible_type > get_default_options() const
void set_options(const std::map< std::string, flexible_type > &_options)