From 407b8668d19ae704204fa4b522952a5831a8f481 Mon Sep 17 00:00:00 2001 From: Jason Silberman Date: Sat, 16 Jun 2018 11:39:45 -0700 Subject: [PATCH] remove sine tests --- SwiftNeuralNetwork.xcodeproj/project.pbxproj | 4 -- Tests/SineTests.swift | 76 -------------------- 2 files changed, 80 deletions(-) delete mode 100644 Tests/SineTests.swift diff --git a/SwiftNeuralNetwork.xcodeproj/project.pbxproj b/SwiftNeuralNetwork.xcodeproj/project.pbxproj index 521a1ad..07143e6 100644 --- a/SwiftNeuralNetwork.xcodeproj/project.pbxproj +++ b/SwiftNeuralNetwork.xcodeproj/project.pbxproj @@ -7,7 +7,6 @@ objects = { /* Begin PBXBuildFile section */ - 966DFD2720C465EF00222F0D /* SineTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 966DFD2620C465EF00222F0D /* SineTests.swift */; }; 966DFD2920C4A35B00222F0D /* DataNormalizer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 966DFD2820C4A35B00222F0D /* DataNormalizer.swift */; }; 966DFD2C20C4B61C00222F0D /* DataNormalizerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 966DFD2B20C4B61C00222F0D /* DataNormalizerTests.swift */; }; 96EC01C620C21072008D3A2F /* SwiftNeuralNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 96EC01BC20C21072008D3A2F /* SwiftNeuralNetwork.framework */; }; @@ -32,7 +31,6 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ - 966DFD2620C465EF00222F0D /* SineTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SineTests.swift; sourceTree = ""; }; 966DFD2820C4A35B00222F0D /* DataNormalizer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DataNormalizer.swift; sourceTree = ""; }; 966DFD2B20C4B61C00222F0D /* DataNormalizerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DataNormalizerTests.swift; sourceTree = ""; }; 96EC01BC20C21072008D3A2F /* SwiftNeuralNetwork.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SwiftNeuralNetwork.framework; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -90,7 +88,6 @@ isa = PBXGroup; children = ( 96EC01D720C210C7008D3A2F /* XORTests.swift */, - 966DFD2620C465EF00222F0D /* SineTests.swift */, 966DFD2B20C4B61C00222F0D /* DataNormalizerTests.swift */, 96EC01D820C210C7008D3A2F /* Info.plist */, ); @@ -242,7 +239,6 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 966DFD2720C465EF00222F0D /* SineTests.swift in Sources */, 966DFD2C20C4B61C00222F0D /* DataNormalizerTests.swift in Sources */, 96EC01D920C210C7008D3A2F /* XORTests.swift in Sources */, ); diff --git a/Tests/SineTests.swift b/Tests/SineTests.swift deleted file mode 100644 index 40b3b9a..0000000 --- a/Tests/SineTests.swift +++ /dev/null @@ -1,76 +0,0 @@ -// -// SineTests.swift -// SwiftNeuralNetworkTests -// -// Created by Jason Silberman on 6/3/18. -// Copyright © 2018 Jason Silberman. All rights reserved. -// - -import XCTest -@testable import SwiftNeuralNetwork - -func generateData(count: Int) -> (xs: [[Double]], ys: [[Double]]) { - let randoms = (0.. threshold && count < maxIterations { - count += 1 - - network.train(inputs: trainingData, targetOutputs: trainingResults, learningRate: Constants.learningRate) - - lastRSS = network.rss(inputs: trainingData, targetOutputs: trainingResults) - } - - if lastRSS > threshold { - XCTFail("FAILED! Could not achieve an RSS of: \(threshold). Final RSS was: \(lastRSS)") - } else { - print("SUCCESSFULLY reached RSS of \(lastRSS) after \(count) tries.") - } - } - - func testSine() { - let validationData: [[Double]] = [[.pi/2]] - let validationResults: [[Double]] = [[1]] - - for (input, expectedResult) in zip(validationData, validationResults) { - let actualResult = network.infer(input: input) - // if difference is within 0.5 then the correct answer was given - print(input, expectedResult, actualResult) -// let difference = abs(actualResult[0] - expectedResult[0]) -// XCTAssertTrue(difference < 0.5, "Network validation failed. Input: \(input). Expected: \(expectedResult). Actual: \(actualResult)") - } - } -}