|
@@ -7,39 +7,39 @@ import (
|
|
|
)
|
|
|
|
|
|
func TestNewNeuralNetwork(t *testing.T) {
|
|
|
- nn, err := NewNeuralNetwork([]int{}, NewBackPropInitializer(0.1))
|
|
|
+ nn, err := NewNeuralNetwork([]int{}, nil)
|
|
|
if nn != nil || err == nil {
|
|
|
t.Error("nn initialized, but shouldn't ", err)
|
|
|
}
|
|
|
|
|
|
- nn, err = NewNeuralNetwork([]int{0, 0, 0, 0}, NewBackPropInitializer(0.1))
|
|
|
+ nn, err = NewNeuralNetwork([]int{0, 0, 0, 0}, nil)
|
|
|
if nn != nil || err == nil {
|
|
|
t.Error("nn initialized, but shouldn't ", err)
|
|
|
}
|
|
|
|
|
|
- nn, err = NewNeuralNetwork([]int{1, 1, 1, 1}, NewBackPropInitializer(0.1))
|
|
|
+ nn, err = NewNeuralNetwork([]int{1, 1, 1, 1}, nil)
|
|
|
if nn != nil || err == nil {
|
|
|
t.Error("nn initialized, but shouldn't ", err)
|
|
|
}
|
|
|
|
|
|
- nn, err = NewNeuralNetwork([]int{5, 5}, NewBackPropInitializer(0.1))
|
|
|
+ nn, err = NewNeuralNetwork([]int{5, 5}, nil)
|
|
|
if nn != nil || err == nil {
|
|
|
t.Error("nn initialized, but shouldn't ", err)
|
|
|
}
|
|
|
|
|
|
- nn, err = NewNeuralNetwork([]int{5, 1, 5, 5}, NewBackPropInitializer(0.1))
|
|
|
+ nn, err = NewNeuralNetwork([]int{5, 1, 5, 5}, nil)
|
|
|
if nn != nil || err == nil {
|
|
|
t.Error("nn initialized, but shouldn't ", err)
|
|
|
}
|
|
|
|
|
|
- nn, err = NewNeuralNetwork([]int{5, 4, 4, 5}, NewBackPropInitializer(0.1))
|
|
|
+ nn, err = NewNeuralNetwork([]int{5, 4, 4, 5}, nil)
|
|
|
if nn == nil || err != nil {
|
|
|
t.Error("nn is not initialized, but should be ", err)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
func TestNeuralNetworkPredict(t *testing.T) {
|
|
|
- nn, _ := NewNeuralNetwork([]int{3, 4, 4, 2}, NewBackPropInitializer(0.1))
|
|
|
+ nn, _ := NewNeuralNetwork([]int{3, 4, 4, 2}, nil)
|
|
|
|
|
|
aIn := &mat.Dense{}
|
|
|
index, max := nn.Predict(aIn)
|