This patch saves optimizer section to ini.
**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped
Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
IniSection model_section = IniSection::FromExportable("model", *this);
model_section.setEntry("type", "NeuralNetwork");
- IniWrapper wrapper("model_saver", {model_section});
+ IniSection optimizer_section = IniSection::FromExportable("optimizer", *opt);
+ optimizer_section.setEntry("type", opt->getType());
+
+ IniWrapper wrapper("model_saver", {model_section, optimizer_section});
wrapper.save_ini(file_path);
IniGraphInterpreter interpreter;
/**
* @copydoc Optimizer::setProperty(const std::vector<std::string> &values)
*/
- virtual void setProperty(const std::vector<std::string> &values) override;
+ void setProperty(const std::vector<std::string> &values) override;
private:
std::tuple<PropsB1, PropsB2, PropsEpsilon> adam_props;
template <>
std::string
str_converter<double_prop_tag, double>::to_string(const double &value) {
- return std::to_string(value);
+ std::ostringstream ss;
+ ss << value;
+ return ss.str();
}
template <>
IniSection() : section_name(""), entry{} {};
/**
- * @brief Construct a new Ini Section object which implements object::exportTo
+ * @brief Construct a new Ini Section object from which implements
+ * object::exportTo
*
* @tparam Exportable object with member object::exportTo
* @param section_name section name
* @param exportable exportable object
+ * @return IniSection created section
*/
template <typename Exportable>
static IniSection FromExportable(const std::string §ion_name,
e.getResult<ExportMethods::METHOD_STRINGVECTOR>();
if (!key_val_pairs) {
- throw std::invalid_argument("returend pairs are nullptr!");
+ throw std::invalid_argument("returned pairs are nullptr!");
}
for (const auto &pair : *key_val_pairs) {