Signed-off-by: Mattia Giambirtone <nocturn9x@nocturn9x.space>
This commit is contained in:
Mattia Giambirtone 2023-03-21 12:27:16 +01:00
parent b11b351d7e
commit 9506c554ec
2 changed files with 1 additions and 2 deletions

View File

@ -8,4 +8,3 @@ var mlp = newNeuralNetwork(@[newDenseLayer(2, 3, Sigmoid),
lossFunc=MSE, learnRate=0.05, momentum=0.55,
weightRange=(start: -1.0, stop: 1.0), biasRange=(start: -1.0, stop: 1.0))
echo mlp.feedforward(newMatrix[float](@[1.0, 2.0]))

View File

@ -98,7 +98,7 @@ proc newDenseLayer*(inputSize: int, outputSize: int, activationFunc: Activation)
proc newNeuralNetwork*(topology: seq[Layer], lossFunc: Loss, learnRate: float, momentum: float,
weightRange, biasRange: tuple[start, stop: float]): NeuralNetwork =
## Initializes a new neural network with
## the given topology and iperparameters.
## the given topology and hyperparameters.
## Weights and biases are initialized with
## random values in the chosen range
new(result)