Skip to content

Commit 98a56e5

Browse files
committed
fixed some very minor spacing
1 parent 32fbf69 commit 98a56e5

File tree

1 file changed

+3
-3
lines changed
  • Classic Computer Science Problems in Swift.playground/Pages/Chapter 7.xcplaygroundpage

1 file changed

+3
-3
lines changed

Classic Computer Science Problems in Swift.playground/Pages/Chapter 7.xcplaygroundpage/Contents.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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

359359
let (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

363363
func wineInterpretOutput(output: [Double]) -> Int {
364364
if output.max()! == output[0] {

0 commit comments

Comments
 (0)