You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Example/MLKit/GeneticOperations.swift
+16-68Lines changed: 16 additions & 68 deletions
Original file line number
Diff line number
Diff line change
@@ -11,40 +11,29 @@ import MachineLearningKit
11
11
import Upsurge
12
12
13
13
/// The GeneticOperations class manages encoding genes into weights for the neural network and decoding neural network weights into genes. These methods are not provided in the framework itself, rather it was for the game example.
14
-
/*
14
+
15
15
finalclassGeneticOperations{
16
16
/**
17
-
The encode method converts aNueralNet object to an array of floats by taking the weights of each layer and placing them into an array.
17
+
The encode method converts aNueralNetwork object to an array of floats by taking the weights of each layer and placing them into an array.
18
18
19
19
- parameter network: A NeuralNet Object.
20
20
21
21
- returns: An array of Float values.
22
22
*/
23
-
public static func encode(network: NeuralNet) -> [Float] {
24
-
25
-
let inputLayerNeurons = network.inputLayer.listOfNeurons
26
-
let outputLayerNeurons = network.outputLayer.listOfNeurons