Add disable bias property for the layer impl class.
Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
};
/**
+ * @brief BiasInitializer Initialization Enumeration Information
+ *
+ */
+class DisableBias : public nntrainer::Property<bool> {
+public:
+ /**
+ * @brief Construct a DisableBias object
+ *
+ */
+ DisableBias(bool val = false) : nntrainer::Property<bool>(val) {}
+ using prop_tag = bool_prop_tag;
+ static constexpr const char *key = "disable_bias";
+};
+
+/**
* @brief Normalization property, normalize the input to be in range [0, 1] if
* true
*
layer_impl_props(
std::make_unique<
std::tuple<props::WeightRegularizer, props::WeightRegularizerConstant,
- props::WeightInitializer, props::BiasInitializer>>()) {}
+ props::WeightInitializer, props::BiasInitializer,
+ props::DisableBias>>()) {}
void LayerImpl::setProperty(const std::vector<std::string> &values) {
auto remain_props = loadProperties(values, *layer_impl_props);
class WeightRegularizerConstant;
class WeightInitializer;
class BiasInitializer;
+class DisableBias;
} // namespace props
enum class ExportMethods;
const ExportMethods &method) const override;
protected:
- std::unique_ptr<
- std::tuple<props::WeightRegularizer, props::WeightRegularizerConstant,
- props::WeightInitializer, props::BiasInitializer>>
+ std::unique_ptr<std::tuple<
+ props::WeightRegularizer, props::WeightRegularizerConstant,
+ props::WeightInitializer, props::BiasInitializer, props::DisableBias>>
layer_impl_props; /**< layer_impl_props */
};
template <>
void Exporter::saveTflResult(
const std::tuple<props::WeightRegularizer, props::WeightRegularizerConstant,
- props::WeightInitializer, props::BiasInitializer> &props,
+ props::WeightInitializer, props::BiasInitializer,
+ props::DisableBias> &props,
const LayerImpl *self) { /// layer impl has nothing to serialize so do nothing
}
class SharedFrom;
class InputConnection;
class ClipGradByGlobalNorm;
+class DisableBias;
} // namespace props
class LayerNode;
template <>
void Exporter::saveTflResult(
const std::tuple<props::WeightRegularizer, props::WeightRegularizerConstant,
- props::WeightInitializer, props::BiasInitializer> &props,
+ props::WeightInitializer, props::BiasInitializer,
+ props::DisableBias> &props,
const LayerImpl *self);
class FullyConnectedLayer;