@@ -133,7 +133,7 @@ class Layer {
133133 var neurons : [ Neuron ]
134134 var outputCache : [ Double ]
135135
136- init ( previousLayer: Layer ? = nil , numNeurons: Int , activationFunction: @escaping ( Double ) -> Double , derivativeActivationFunction: @escaping ( Double ) -> Double , learningRate: Double ) {
136+ init ( previousLayer: Layer ? = nil , numNeurons: Int , activationFunction: @escaping ( Double ) -> Double , derivativeActivationFunction: @escaping ( Double ) -> Double , learningRate: Double ) {
137137 self . previousLayer = previousLayer
138138 self . neurons = Array < Neuron > ( )
139139 for _ in 0 ..< numNeurons {
@@ -222,7 +222,7 @@ class Network {
222222 /// train() uses the results of outputs() run over
223223 /// many *inputs* and compared against *expecteds* to feed
224224 /// backpropagate() and updateWeights()
225- func train( inputs: [ [ Double ] ] , expecteds: [ [ Double ] ] , printError: Bool = false , threshold: Double ? = nil ) {
225+ func train( inputs: [ [ Double ] ] , expecteds: [ [ Double ] ] , printError: Bool = false , threshold: Double ? = nil ) {
226226 for (location, xs) in inputs. enumerated ( ) {
227227 let ys = expecteds [ location]
228228 let outs = outputs ( input: xs)
@@ -358,7 +358,7 @@ func parseWineCSV() -> (parameters: [[Double]], classifications: [[Double]], spe
358358
359359let ( wineParameters, wineClassifications, wineSpecies) = parseWineCSV ( )
360360
361- let wineNetwork : Network = Network ( layerStructure: [ 13 , 7 , 3 ] , learningRate: 0.9 )
361+ let wineNetwork : Network = Network ( layerStructure: [ 13 , 7 , 3 ] , learningRate: 0.9 )
362362
363363func wineInterpretOutput( output: [ Double ] ) -> Int {
364364 if output. max ( ) ! == output [ 0 ] {
0 commit comments