Skip to content
Browse files

get_weights -> get_weight_array for consistency

  • Loading branch information...
1 parent 6dbfa8f commit 3611715f553528b36ad6c577d4867eab804fafa7 @rlidwka committed Oct 13, 2012
Showing with 8 additions and 6 deletions.
  1. +4 −2 src/fann.cc
  2. +4 −4 tests/conn_set.js
View
6 src/fann.cc
@@ -43,8 +43,10 @@ void NNet::PrototypeInit(Local<FunctionTemplate> t)
NODE_SET_PROTOTYPE_METHOD(t, "get_layer_array", GetLayerArray);
NODE_SET_PROTOTYPE_METHOD(t, "get_bias_array", GetBiasArray);
- NODE_SET_PROTOTYPE_METHOD(t, "get_weights", GetWeights);
- NODE_SET_PROTOTYPE_METHOD(t, "set_weights", SetWeights);
+ NODE_SET_PROTOTYPE_METHOD(t, "get_weight_array", GetWeights);
+ NODE_SET_PROTOTYPE_METHOD(t, "set_weight_array", SetWeights);
+ NODE_SET_PROTOTYPE_METHOD(t, "get_weight", GetWeights);
+ NODE_SET_PROTOTYPE_METHOD(t, "set_weight", SetWeights);
t->InstanceTemplate()->SetAccessor(String::New("training_algorithm"), GetTrainingAlgorithm, SetTrainingAlgorithm);
t->InstanceTemplate()->SetAccessor(String::New("learning_rate"), GetLearningRate, SetLearningRate);
t->InstanceTemplate()->SetAccessor(String::New("learning_momentum"), GetLearningMomentum, SetLearningMomentum);
View
8 tests/conn_set.js
@@ -9,14 +9,14 @@ var net = new fann.standard(2,5,1);
var conn;
// changing individual connection
-conn = net.get_weights();
+conn = net.get_weight_array();
var oldconn = conn[3][9];
conn[3][9] = 0.9;
-net.set_weights(conn);
+net.set_weight_array(conn);
// changing specified connection
-net.set_weights(4, 9, 0.4);
-conn = net.get_weights();
+net.set_weight(4, 9, 0.4);
+conn = net.get_weight_array();
console.log(conn[3][9]);
console.log(conn[4][9]);
//assert.equal(conn[3][9], 0.9, 'set individual conn');

0 comments on commit 3611715

Please sign in to comment.
Something went wrong with that request. Please try again.