diff --git a/doc_classes/MLPPVector.xml b/doc_classes/MLPPVector.xml index bfc97ec..da0eab7 100644 --- a/doc_classes/MLPPVector.xml +++ b/doc_classes/MLPPVector.xml @@ -29,7 +29,7 @@ - + diff --git a/mlpp/gan/gan.cpp b/mlpp/gan/gan.cpp index 7799c9a..798327c 100644 --- a/mlpp/gan/gan.cpp +++ b/mlpp/gan/gan.cpp @@ -65,7 +65,7 @@ void MLPPGAN::gradient_descent(real_t learning_rate, int max_epoch, bool ui) { Ref y_hat = model_set_test_discriminator(discriminator_input_set); Ref output_set = alg.zerovecnv(_n); Ref output_set_real = alg.onevecnv(_n); - output_set->add_mlpp_vector(output_set_real); // Fake + real output scores. + output_set->append_mlpp_vector(output_set_real); // Fake + real output scores. ComputeDiscriminatorGradientsResult dgrads = compute_discriminator_gradients(y_hat, _output_set); diff --git a/mlpp/lin_alg/mlpp_vector.cpp b/mlpp/lin_alg/mlpp_vector.cpp index ff0589d..31d9d70 100644 --- a/mlpp/lin_alg/mlpp_vector.cpp +++ b/mlpp/lin_alg/mlpp_vector.cpp @@ -36,7 +36,7 @@ void MLPPVector::push_back(real_t p_elem) { _data[_size - 1] = p_elem; } -void MLPPVector::add_mlpp_vector(const Ref &p_other) { +void MLPPVector::append_mlpp_vector(const Ref &p_other) { ERR_FAIL_COND(!p_other.is_valid()); int other_size = p_other->size(); @@ -899,7 +899,7 @@ void MLPPVector::absb(const Ref &a) { } } -Ref MLPPVector::zero_vec(int n) const { +Ref MLPPVector::vecn_zero(int n) const { Ref vec; vec.instance(); @@ -908,7 +908,7 @@ Ref MLPPVector::zero_vec(int n) const { return vec; } -Ref MLPPVector::one_vec(int n) const { +Ref MLPPVector::vecn_one(int n) const { Ref vec; vec.instance(); @@ -917,7 +917,7 @@ Ref MLPPVector::one_vec(int n) const { return vec; } -Ref MLPPVector::full_vec(int n, int k) const { +Ref MLPPVector::vecn_full(int n, int k) const { Ref vec; vec.instance(); @@ -1360,7 +1360,7 @@ void MLPPVector::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::POOL_REAL_ARRAY, "data"), "set_data", "get_data"); ClassDB::bind_method(D_METHOD("push_back", "elem"), &MLPPVector::push_back); - ClassDB::bind_method(D_METHOD("add_mlpp_vector", "other"), &MLPPVector::push_back); + ClassDB::bind_method(D_METHOD("append_mlpp_vector", "other"), &MLPPVector::append_mlpp_vector); ClassDB::bind_method(D_METHOD("remove", "index"), &MLPPVector::remove); ClassDB::bind_method(D_METHOD("remove_unordered", "index"), &MLPPVector::remove_unordered); ClassDB::bind_method(D_METHOD("erase", "val"), &MLPPVector::erase); @@ -1450,9 +1450,9 @@ void MLPPVector::_bind_methods() { ClassDB::bind_method(D_METHOD("absn"), &MLPPVector::absn); ClassDB::bind_method(D_METHOD("absb", "a"), &MLPPVector::absb); - ClassDB::bind_method(D_METHOD("zero_vec", "n"), &MLPPVector::zero_vec); - ClassDB::bind_method(D_METHOD("one_vec", "n"), &MLPPVector::one_vec); - ClassDB::bind_method(D_METHOD("full_vec", "n", "k"), &MLPPVector::full_vec); + ClassDB::bind_method(D_METHOD("vecn_zero", "n"), &MLPPVector::vecn_zero); + ClassDB::bind_method(D_METHOD("vecn_one", "n"), &MLPPVector::vecn_one); + ClassDB::bind_method(D_METHOD("vecn_full", "n", "k"), &MLPPVector::vecn_full); ClassDB::bind_method(D_METHOD("sin"), &MLPPVector::sin); ClassDB::bind_method(D_METHOD("sinn"), &MLPPVector::sinn); diff --git a/mlpp/lin_alg/mlpp_vector.h b/mlpp/lin_alg/mlpp_vector.h index f2f094c..daea68e 100644 --- a/mlpp/lin_alg/mlpp_vector.h +++ b/mlpp/lin_alg/mlpp_vector.h @@ -33,7 +33,7 @@ public: } void push_back(real_t p_elem); - void add_mlpp_vector(const Ref &p_other); + void append_mlpp_vector(const Ref &p_other); void remove(real_t p_index); @@ -177,9 +177,9 @@ public: Ref absn() const; void absb(const Ref &a); - Ref zero_vec(int n) const; - Ref one_vec(int n) const; - Ref full_vec(int n, int k) const; + Ref vecn_zero(int n) const; + Ref vecn_one(int n) const; + Ref vecn_full(int n, int k) const; void sin(); Ref sinn() const; diff --git a/mlpp/wgan/wgan.cpp b/mlpp/wgan/wgan.cpp index de67b2a..5d3defd 100644 --- a/mlpp/wgan/wgan.cpp +++ b/mlpp/wgan/wgan.cpp @@ -71,7 +71,7 @@ void MLPPWGAN::gradient_descent(real_t learning_rate, int max_epoch, bool ui) { ly_hat = model_set_test_discriminator(discriminator_input_set); loutput_set = alg.scalar_multiplynv(-1, alg.onevecnv(_n)); // WGAN changes y_i = 1 and y_i = 0 to y_i = 1 and y_i = -1 Ref output_set_real = alg.onevecnv(_n); - loutput_set->add_mlpp_vector(output_set_real); // Fake + real output scores. + loutput_set->append_mlpp_vector(output_set_real); // Fake + real output scores. DiscriminatorGradientResult discriminator_gradient_results = compute_discriminator_gradients(ly_hat, loutput_set); Vector> cumulative_discriminator_hidden_layer_w_grad = discriminator_gradient_results.cumulative_hidden_layer_w_grad;