using prop_tag = float_prop_tag; /**< property type */
};
+/**
+ * @brief Learning Rate props
+ *
+ */
+class LearningRate : public Property<float> {
+public:
+ static constexpr const char *key =
+ "learning_rate"; /**< unique key to access */
+ using prop_tag = float_prop_tag; /**< property type */
+};
+
+/**
+ * @brief Decay rate property
+ *
+ */
+class DecayRate : public Property<float> {
+public:
+ static constexpr const char *key = "decay_rate"; /**< unique key to access */
+ using prop_tag = float_prop_tag; /**< property type */
+};
+
+/**
+ * @brief decay steps property
+ *
+ */
+class DecaySteps : public PositiveIntegerProperty {
+public:
+ static constexpr const char *key = "decay_steps"; /**< unique key to access */
+ using prop_tag = uint_prop_tag; /**< property type */
+};
+
} // namespace props
} // namespace nntrainer
*
*/
+#include <cmath>
#include <fstream>
#include <iostream>
-#include <cmath>
+#include <common_properties.h>
#include <nntrainer_error.h>
#include <nntrainer_log.h>
#include <node_exporter.h>
namespace nntrainer {
OptimizerImpl::OptimizerImpl() :
- optimizer_impl_props(PropsLR(), PropsDecayRate(), PropsDecaySteps()) {}
+ optimizer_impl_props(props::LearningRate(), props::DecayRate(),
+ props::DecaySteps()) {}
void OptimizerImpl::setProperty(const std::vector<std::string> &values) {
auto left = loadProperties(values, optimizer_impl_props);
#include <tuple>
-#include <base_properties.h>
+#include <common_properties.h>
#include <optimizer_devel.h>
namespace nntrainer {
/**
- * @brief Learning Rate props
- *
- */
-class PropsLR : public Property<float> {
-public:
- static constexpr const char *key =
- "learning_rate"; /**< unique key to access */
- using prop_tag = float_prop_tag; /**< property type */
-};
-
-/**
- * @brief Decay rate property
- *
- */
-class PropsDecayRate : public Property<float> {
-public:
- static constexpr const char *key = "decay_rate"; /**< unique key to access */
- using prop_tag = float_prop_tag; /**< property type */
-};
-
-/**
- * @brief decay steps property
- *
- */
-class PropsDecaySteps : public PositiveIntegerProperty {
-public:
- static constexpr const char *key = "decay_steps"; /**< unique key to access */
- using prop_tag = uint_prop_tag; /**< property type */
-};
-
-/**
* @class Optimizer Base class for optimizers
* @brief Basic implementation class for nntrainer supported optimizers
*/
}
protected:
- std::tuple<PropsLR, PropsDecayRate, PropsDecaySteps> optimizer_impl_props;
+ std::tuple<props::LearningRate, props::DecayRate, props::DecaySteps>
+ optimizer_impl_props;
};
} /* namespace nntrainer */