mirror of
https://github.com/Relintai/pmlpp.git
synced 2025-01-02 16:29:35 +01:00
MLPPTanhReg small tweaks.
This commit is contained in:
parent
9d7fc44ca6
commit
15f781c8c2
@ -52,6 +52,10 @@ Ref<MLPPVector> MLPPTanhReg::data_z_get() const {
|
|||||||
return _z;
|
return _z;
|
||||||
}
|
}
|
||||||
void MLPPTanhReg::data_z_set(const Ref<MLPPVector> &val) {
|
void MLPPTanhReg::data_z_set(const Ref<MLPPVector> &val) {
|
||||||
|
if (!val.is_valid()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
_z = val;
|
_z = val;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -59,6 +63,10 @@ Ref<MLPPVector> MLPPTanhReg::data_y_hat_get() const {
|
|||||||
return _y_hat;
|
return _y_hat;
|
||||||
}
|
}
|
||||||
void MLPPTanhReg::data_y_hat_set(const Ref<MLPPVector> &val) {
|
void MLPPTanhReg::data_y_hat_set(const Ref<MLPPVector> &val) {
|
||||||
|
if (!val.is_valid()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
_y_hat = val;
|
_y_hat = val;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -66,6 +74,10 @@ Ref<MLPPVector> MLPPTanhReg::data_weights_get() const {
|
|||||||
return _weights;
|
return _weights;
|
||||||
}
|
}
|
||||||
void MLPPTanhReg::data_weights_set(const Ref<MLPPVector> &val) {
|
void MLPPTanhReg::data_weights_set(const Ref<MLPPVector> &val) {
|
||||||
|
if (!val.is_valid()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
_weights = val;
|
_weights = val;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -381,6 +393,7 @@ void MLPPTanhReg::_bind_methods() {
|
|||||||
ClassDB::bind_method(D_METHOD("set_alpha", "val"), &MLPPTanhReg::set_alpha);
|
ClassDB::bind_method(D_METHOD("set_alpha", "val"), &MLPPTanhReg::set_alpha);
|
||||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "alpha"), "set_alpha", "get_alpha");
|
ADD_PROPERTY(PropertyInfo(Variant::REAL, "alpha"), "set_alpha", "get_alpha");
|
||||||
|
|
||||||
|
ADD_GROUP("Data", "data");
|
||||||
ClassDB::bind_method(D_METHOD("data_z_get"), &MLPPTanhReg::data_z_get);
|
ClassDB::bind_method(D_METHOD("data_z_get"), &MLPPTanhReg::data_z_get);
|
||||||
ClassDB::bind_method(D_METHOD("data_z_set", "val"), &MLPPTanhReg::set_output_set);
|
ClassDB::bind_method(D_METHOD("data_z_set", "val"), &MLPPTanhReg::set_output_set);
|
||||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "data_z", PROPERTY_HINT_RESOURCE_TYPE, "MLPPVector"), "data_z_set", "data_z_get");
|
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "data_z", PROPERTY_HINT_RESOURCE_TYPE, "MLPPVector"), "data_z_set", "data_z_get");
|
||||||
|
Loading…
Reference in New Issue
Block a user