// Creates a feed forward neural network with all inputs, hidden layers,
// and output layer nodes.
Creates a feed forward neural network with all inputs, hidden layers,
and output layer nodes.
// Creates a feed forward neural network with all inputs hidden layers // and output layer nodes .
func NewNetwork(inputs, outputs int, hiddenLayers []int, hiddenAct, outAct ActivationFunction) *Network {
	net := &Network{
		Inputs: make([]float64, inputs),
		Layers: make([]*Layer, len(hiddenLayers)+1),
	}
	prevNodes := inputs
	for h, hidden := range hiddenLayers {
		if hidden < 1 {
			panic(fmt.Sprintf("NewNetwork ERROR number of hidden nodes %d in layer %d is below 1", hidden, h))
		}
		net.Layers[h] = createLayer(hidden, prevNodes, hiddenAct)
		prevNodes = hidden
	}
	net.Layers[len(hiddenLayers)] = createLayer(outputs, prevNodes, outAct)
	return net
}
func NewNetwork ( inputs , outputs int , hiddenLayers [ ] int , hiddenAct , outAct ActivationFunction ) * Network { net := & Network { Inputs : make ( [ ] float64 , inputs ) , Layers : make ( [ ] * Layer , len ( hiddenLayers ) + 1 ) , } prevNodes := inputs for h , hidden := range hiddenLayers { if hidden < 1 { panic ( fmt . Sprintf ( " " , hidden , h ) ) } net . Layers [ h ] = createLayer ( hidden , prevNodes , hiddenAct ) prevNodes = hidden } net . Layers [ len ( hiddenLayers ) ] = createLayer ( outputs , prevNodes , outAct ) return net }
Creates a feed forward neural network with all inputs, hidden layers,
and output layer nodes.
Creates a feed forward neural network with all inputs hidden layers and output layer nodes .
// Add the output as the last layer