Skip to content

Commit

Permalink
Merge pull request #9 from Qwerp-Derp/patch-1
Browse files Browse the repository at this point in the history
Correct `algorithem` to `algorithm`
  • Loading branch information
bararchy committed Oct 10, 2017
2 parents b6b337e + c692f61 commit c33072f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ input = [[0.0, 0.0], [0.0, 1.0], [1.0, 0.0], [1.0, 1.0]]
output = [[0.0], [1.0], [1.0], [0.0]]
train_data = Fann::TrainData.new(input, output)
data = train_data.train_data
ann.train_algorithem(LibFANN::TrainEnum::TrainRprop)
ann.train_algorithm(LibFANN::TrainEnum::TrainRprop)
ann.set_hidden_layer_activation_func(LibFANN::ActivationfuncEnum::Linear)
ann.set_output_layer_activation_func(LibFANN::ActivationfuncEnum::Linear)
if data
Expand All @@ -56,7 +56,7 @@ input = [[0.0, 0.0], [0.0, 1.0], [1.0, 0.0], [1.0, 1.0]]
output = [[0.0], [1.0], [1.0], [0.0]]
train_data = Fann::TrainData.new(input, output)
data = train_data.train_data
ann.train_algorithem(LibFANN::TrainEnum::TrainRprop)
ann.train_algorithm(LibFANN::TrainEnum::TrainRprop)
ann.set_hidden_layer_activation_func(LibFANN::ActivationfuncEnum::Linear)
ann.set_output_layer_activation_func(LibFANN::ActivationfuncEnum::Linear)
if data
Expand Down
10 changes: 5 additions & 5 deletions spec/network_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe Fann::Network do

it "trains on single data" do
ann = Fann::Network::Standard.new(2, [2, 2], 1)
ann.randomzie_weights(0.0, 1.0)
ann.randomize_weights(0.0, 1.0)
3000.times do
ann.train_single([1.0, 0.0], [0.5])
end
Expand All @@ -34,7 +34,7 @@ describe Fann::Network do

it "trains and evaluate single data" do
ann = Fann::Network::Standard.new(2, [2], 1)
ann.randomzie_weights(0.0, 1.0)
ann.randomize_weights(0.0, 1.0)
3000.times do
ann.train_single([1.0, 0.0], [0.5])
end
Expand All @@ -50,7 +50,7 @@ describe Fann::Network do
train_data = Fann::TrainData.new(input, output)
data = train_data.train_data
# ann.train_algorithem(LibFANN::TrainEnum::TrainSarprop)
ann.randomzie_weights(0.0, 1.0)
ann.randomize_weights(0.0, 1.0)
# ann.set_hidden_layer_activation_func(LibFANN::ActivationfuncEnum::LeakyRelu)
# ann.set_output_layer_activation_func(LibFANN::ActivationfuncEnum::LeakyRelu)
if data
Expand All @@ -67,8 +67,8 @@ describe Fann::Network do
output = [[0.0], [1.0], [1.0], [0.0]]
train_data = Fann::TrainData.new(input, output)
data = train_data.train_data
ann.train_algorithem(LibFANN::TrainEnum::TrainRprop)
ann.randomzie_weights(0.0, 1.0)
ann.train_algorithm(LibFANN::TrainEnum::TrainRprop)
ann.randomize_weights(0.0, 1.0)
if data
ann.train_batch(data, {:max_neurons => 500, :desired_mse => 0.001, :log_each => 10})
end
Expand Down
4 changes: 2 additions & 2 deletions src/crystal-fann/cascade_network.cr
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module Fann
LibFANN.destroy(@nn)
end

def train_algorithem(algo : LibFANN::TrainEnum)
def train_algorithm(algo : LibFANN::TrainEnum)
LibFANN.set_training_algorithm(@nn, algo)
end

Expand All @@ -37,7 +37,7 @@ module Fann
LibFANN.set_activation_function_hidden(@nn, func)
end

def randomzie_weights(min : Float64, max : Float64)
def randomize_weights(min : Float64, max : Float64)
# randomize_weights = fann_randomize_weights(ann : Fann*, min_weight : Type, max_weight : Type)
LibFANN.randomize_weights(@nn, min, max)
end
Expand Down
4 changes: 2 additions & 2 deletions src/crystal-fann/standard_network.cr
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ module Fann
LibFANN.destroy(@nn)
end

def train_algorithem(algo : LibFANN::TrainEnum)
def train_algorithm(algo : LibFANN::TrainEnum)
LibFANN.set_training_algorithm(@nn, algo)
end

Expand All @@ -46,7 +46,7 @@ module Fann
LibFANN.set_activation_function_output(@nn, func)
end

def randomzie_weights(min : Float64, max : Float64)
def randomize_weights(min : Float64, max : Float64)
# randomize_weights = fann_randomize_weights(ann : Fann*, min_weight : Type, max_weight : Type)
LibFANN.randomize_weights(@nn, min, max)
end
Expand Down

0 comments on commit c33072f

Please sign in to comment.