From 4c262f8716e03376af5622903b5d575d048af908 Mon Sep 17 00:00:00 2001 From: araki Date: Mon, 26 Sep 2016 18:54:52 +0900 Subject: [PATCH 01/26] Update for swift3. --- TensorSwift.xcodeproj/project.pbxproj | 14 +++++++ TensorSwift/Dimension.swift | 2 +- TensorSwift/Operators.swift | 6 ++- TensorSwift/Shape.swift | 2 +- TensorSwift/Tensor.swift | 22 +++++----- TensorSwift/TensorNN.swift | 40 +++++++++---------- TensorSwift/Utils.swift | 8 ++-- .../CalculationPerformanceTests.swift | 16 ++++---- TensorSwiftTests/DimensionTest.swift | 19 ++++----- TensorSwiftTests/PowerTest.swift | 26 ++++++++++++ TensorSwiftTests/TensorNNTest.swift | 6 +-- TensorSwiftTests/TensorTest.swift | 2 +- 12 files changed, 104 insertions(+), 59 deletions(-) create mode 100644 TensorSwiftTests/PowerTest.swift diff --git a/TensorSwift.xcodeproj/project.pbxproj b/TensorSwift.xcodeproj/project.pbxproj index f12fb9e..e236ed3 100644 --- a/TensorSwift.xcodeproj/project.pbxproj +++ b/TensorSwift.xcodeproj/project.pbxproj @@ -8,6 +8,7 @@ /* Begin PBXBuildFile section */ 273614FA1CB3E72200CF4935 /* SHA1.swift in Sources */ = {isa = PBXBuildFile; fileRef = 273614F91CB3E72200CF4935 /* SHA1.swift */; }; + A7DF6CC61D9924C30097CEB7 /* PowerTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7DF6CC51D9924C30097CEB7 /* PowerTest.swift */; }; A7E021DB1CAA4B2F00BAFC54 /* CalculationPerformanceTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7E021DA1CAA4B2F00BAFC54 /* CalculationPerformanceTests.swift */; }; D6312E411CE33BB700985B92 /* Classifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = D6312E401CE33BB700985B92 /* Classifier.swift */; }; D6312E431CE4341500985B92 /* ClassifierTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = D6312E421CE4341500985B92 /* ClassifierTest.swift */; }; @@ -149,6 +150,7 @@ /* Begin PBXFileReference section */ 273614F91CB3E72200CF4935 /* SHA1.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SHA1.swift; sourceTree = ""; }; 273614FC1CB3E81B00CF4935 /* MNISTTests-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "MNISTTests-Bridging-Header.h"; sourceTree = ""; }; + A7DF6CC51D9924C30097CEB7 /* PowerTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PowerTest.swift; sourceTree = ""; }; A7E021DA1CAA4B2F00BAFC54 /* CalculationPerformanceTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CalculationPerformanceTests.swift; sourceTree = ""; }; D6312E401CE33BB700985B92 /* Classifier.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Classifier.swift; sourceTree = ""; }; D6312E421CE4341500985B92 /* ClassifierTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ClassifierTest.swift; sourceTree = ""; }; @@ -373,6 +375,7 @@ D69C34101C8ED4FC007985D4 /* TensorNNTest.swift */, D6312E6F1CE5D7BB00985B92 /* DimensionTest.swift */, A7E021DA1CAA4B2F00BAFC54 /* CalculationPerformanceTests.swift */, + A7DF6CC51D9924C30097CEB7 /* PowerTest.swift */, D69C34051C8D8F87007985D4 /* TensorSwiftSample.swift */, D69C33F61C8D731C007985D4 /* Info.plist */, ); @@ -599,9 +602,11 @@ }; D69C33E41C8D731C007985D4 = { CreatedOnToolsVersion = 7.2.1; + LastSwiftMigration = 0800; }; D69C33EE1C8D731C007985D4 = { CreatedOnToolsVersion = 7.2.1; + LastSwiftMigration = 0800; }; D6CE6C821CEED6F7004EAAE9 = { CreatedOnToolsVersion = 7.3; @@ -780,6 +785,7 @@ D69C34111C8ED4FD007985D4 /* TensorNNTest.swift in Sources */, D6312E701CE5D7BB00985B92 /* DimensionTest.swift in Sources */, A7E021DB1CAA4B2F00BAFC54 /* CalculationPerformanceTests.swift in Sources */, + A7DF6CC61D9924C30097CEB7 /* PowerTest.swift in Sources */, D69C34061C8D8F87007985D4 /* TensorSwiftSample.swift in Sources */, D69C33F51C8D731C007985D4 /* TensorTest.swift in Sources */, ); @@ -1048,7 +1054,10 @@ isa = XCBuildConfiguration; buildSettings = { CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = ""; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; @@ -1060,6 +1069,7 @@ PRODUCT_NAME = TensorSwift; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 3.0; }; name = Debug; }; @@ -1068,6 +1078,7 @@ buildSettings = { CLANG_ENABLE_MODULES = YES; DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = ""; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; @@ -1078,6 +1089,7 @@ PRODUCT_NAME = TensorSwift; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 3.0; }; name = Release; }; @@ -1088,6 +1100,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = jp.co.qoncept.TensorSwiftTests; PRODUCT_NAME = TensorSwiftTests; + SWIFT_VERSION = 3.0; }; name = Debug; }; @@ -1098,6 +1111,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = jp.co.qoncept.TensorSwiftTests; PRODUCT_NAME = TensorSwiftTests; + SWIFT_VERSION = 3.0; }; name = Release; }; diff --git a/TensorSwift/Dimension.swift b/TensorSwift/Dimension.swift index e2320e6..9910221 100644 --- a/TensorSwift/Dimension.swift +++ b/TensorSwift/Dimension.swift @@ -7,7 +7,7 @@ public struct Dimension { } } -extension Dimension: IntegerLiteralConvertible { +extension Dimension: ExpressibleByIntegerLiteral { public init(integerLiteral value: Int) { self.init(value) } diff --git a/TensorSwift/Operators.swift b/TensorSwift/Operators.swift index 20818ae..106438e 100644 --- a/TensorSwift/Operators.swift +++ b/TensorSwift/Operators.swift @@ -1 +1,5 @@ -infix operator ** { associativity left precedence 170 } \ No newline at end of file +infix operator ** : PowerPrecedence +precedencegroup PowerPrecedence { + associativity: right + higherThan: MultiplicationPrecedence +} diff --git a/TensorSwift/Shape.swift b/TensorSwift/Shape.swift index 466cbec..4de9190 100644 --- a/TensorSwift/Shape.swift +++ b/TensorSwift/Shape.swift @@ -10,7 +10,7 @@ public struct Shape { } } -extension Shape: ArrayLiteralConvertible { +extension Shape: ExpressibleByArrayLiteral { public init(arrayLiteral elements: Dimension...) { self.init(elements) } diff --git a/TensorSwift/Tensor.swift b/TensorSwift/Tensor.swift index 191087b..61bf6e7 100644 --- a/TensorSwift/Tensor.swift +++ b/TensorSwift/Tensor.swift @@ -7,7 +7,7 @@ public struct Tensor { public typealias Element = Float public let shape: Shape - public private(set) var elements: [Element] + public fileprivate(set) var elements: [Element] public init(shape: Shape, elements: [Element]) { let volume = shape.volume @@ -19,18 +19,18 @@ public struct Tensor { extension Tensor { // Additional Initializers public init(shape: Shape, element: Element = 0.0) { - self.init(shape: shape, elements: [Element](count: shape.volume, repeatedValue: element)) + self.init(shape: shape, elements: [Element](repeating: element, count: shape.volume)) } } extension Tensor { - public func reshape(shape: Shape) -> Tensor { + public func reshape(_ shape: Shape) -> Tensor { return Tensor(shape: shape, elements: elements) } } extension Tensor { // like CollentionType - internal func index(indices: [Int]) -> Int { + internal func index(_ indices: [Int]) -> Int { assert(indices.count == shape.dimensions.count, "`indices.count` must be \(shape.dimensions.count): \(indices.count)") return zip(shape.dimensions, indices).reduce(0) { assert(0 <= $1.1 && $1.1 < $1.0.value, "Illegal index: indices = \(indices), shape = \(shape)") @@ -52,9 +52,9 @@ extension Tensor { // like CollentionType } } -extension Tensor: SequenceType { - public func generate() -> IndexingGenerator<[Element]> { - return elements.generate() +extension Tensor: Sequence { + public func makeIterator() -> IndexingIterator<[Element]> { + return elements.makeIterator() } } @@ -63,7 +63,7 @@ public func ==(lhs: Tensor, rhs: Tensor) -> Bool { return lhs.shape == rhs.shape && lhs.elements == rhs.elements } -internal func commutativeBinaryOperation(lhs: Tensor, _ rhs: Tensor, operation: (Float, Float) -> Float) -> Tensor { +internal func commutativeBinaryOperation(_ lhs: Tensor, _ rhs: Tensor, operation: (Float, Float) -> Float) -> Tensor { let lSize = lhs.shape.dimensions.count let rSize = rhs.shape.dimensions.count @@ -86,7 +86,7 @@ internal func commutativeBinaryOperation(lhs: Tensor, _ rhs: Tensor, operation: return Tensor(shape: a.shape, elements: zipMapRepeat(a.elements, b.elements, operation: operation)) } -internal func noncommutativeBinaryOperation(lhs: Tensor, _ rhs: Tensor, operation: (Float, Float) -> Float) -> Tensor { +internal func noncommutativeBinaryOperation(_ lhs: Tensor, _ rhs: Tensor, operation: (Float, Float) -> Float) -> Tensor { let lSize = lhs.shape.dimensions.count let rSize = rhs.shape.dimensions.count @@ -135,7 +135,7 @@ public func /(lhs: Float, rhs: Tensor) -> Tensor { } extension Tensor { // Matrix - public func matmul(tensor: Tensor) -> Tensor { + public func matmul(_ tensor: Tensor) -> Tensor { precondition(shape.dimensions.count == 2, "This tensor is not a matrix: shape = \(shape)") precondition(tensor.shape.dimensions.count == 2, "The given tensor is not a matrix: shape = \(tensor.shape)") precondition(tensor.shape.dimensions[0] == shape.dimensions[1], "Incompatible shapes of matrices: self.shape = \(shape), tensor.shape = \(tensor.shape)") @@ -158,7 +158,7 @@ extension Tensor { // Matrix tensor.elements, // B n, // ldb 1.0, // beta - UnsafeMutablePointer(result.elements), // C + UnsafeMutablePointer(mutating: result.elements), // C n // ldc ) diff --git a/TensorSwift/TensorNN.swift b/TensorSwift/TensorNN.swift index 1579d11..9c0bc38 100644 --- a/TensorSwift/TensorNN.swift +++ b/TensorSwift/TensorNN.swift @@ -6,7 +6,7 @@ import Accelerate extension Tensor { public var softmax: Tensor { let exps = exp - let sum = exps.elements.reduce(0.0, combine: +) + let sum = exps.elements.reduce(0.0, +) return exps / sum } @@ -16,7 +16,7 @@ extension Tensor { } extension Tensor { - public func maxPool(kernelSize kernelSize: [Int], strides: [Int]) -> Tensor { // padding = Same + public func maxPool(kernelSize: [Int], strides: [Int]) -> Tensor { // padding = Same precondition(shape.dimensions.count == 3, "`shape.dimensions.count` must be 3: \(shape.dimensions.count)") precondition(kernelSize.count == 3, "`ksize.count` must be 3: \(kernelSize.count)") precondition(kernelSize[2] == 1, "`ksize[3]` != 1 is not supported: \(kernelSize[2])") @@ -42,25 +42,25 @@ extension Tensor { let outCols = shape.dimensions[1].value.ceilDiv(colStride) // Initialize with -infinity for maximization. - let elements = [Element](count: outCols * outRows * numChannels, repeatedValue: -Float.infinity) + let elements = [Element](repeating: -Float.infinity, count: outCols * outRows * numChannels) for y in 0..(self.elements) + (inY * inCols + inMinX) * numChannels + var inPointer = UnsafeMutablePointer(mutating: self.elements) + (inY * inCols + inMinX) * numChannels for _ in inMinX...inMaxX { - var outPointer = UnsafeMutablePointer(elements) + outPixelIndex * numChannels + var outPointer = UnsafeMutablePointer(mutating: elements) + outPixelIndex * numChannels for _ in 0.. Tensor { // padding = Same + public func conv2d(filter: Tensor, strides: [Int]) -> Tensor { // padding = Same let inChannels = filter.shape.dimensions[2].value precondition(shape.dimensions.count == 3, "`shape.dimensions.count` must be 3: \(shape.dimensions.count)") @@ -106,22 +106,22 @@ extension Tensor { // a.shape == [outRows * outCols, rowSize] let rowSize = filterHeight * filterWidth * inChannels - let a = [Float](count: outRows * outCols * rowSize, repeatedValue: 0) + let a = [Float](repeating: 0, count: outRows * outCols * rowSize) for y in 0..(a) + ((y * outCols + x) * filterHeight - min(inY0 + inMinDy, 0)) * filterWidth * inChannels + var dest = UnsafeMutablePointer(mutating: a) + ((y * outCols + x) * filterHeight - Swift.min(inY0 + inMinDy, 0)) * filterWidth * inChannels var src = elementsPointer + (inMinY * inCols + inMinX) * inChannels for _ in inMinY...inMaxY { - memcpy(dest - min(inMinX + inMinDx, 0) * inChannels, src, (inMinX...inMaxX).count * inChannels * sizeof(Float)) + memcpy(dest - Swift.min(inMinX + inMinDx, 0) * inChannels, src, (inMinX...inMaxX).count * inChannels * MemoryLayout.size) dest += filterWidth * inChannels src += inCols * inChannels } @@ -147,7 +147,7 @@ extension Tensor { UnsafePointer(filter.elements), // B n, // ldb 1.0, // beta - UnsafeMutablePointer(result.elements), // C + UnsafeMutablePointer(mutating: result.elements), // C n // ldc ) @@ -200,4 +200,4 @@ extension Tensor { v += 1 } } -#endif \ No newline at end of file +#endif diff --git a/TensorSwift/Utils.swift b/TensorSwift/Utils.swift index dcbad7a..78f680d 100644 --- a/TensorSwift/Utils.swift +++ b/TensorSwift/Utils.swift @@ -1,15 +1,15 @@ extension Int { - internal func ceilDiv(rhs: Int) -> Int { + internal func ceilDiv(_ rhs: Int) -> Int { return (self + rhs - 1) / rhs } } -internal func hasSuffix(array array: [Element], suffix: [Element]) -> Bool { +internal func hasSuffix(array: [Element], suffix: [Element]) -> Bool { guard array.count >= suffix.count else { return false } return zip(array[(array.count - suffix.count).. Float) -> [Float] { +internal func zipMap(_ a: [Float], _ b: [Float], operation: (Float, Float) -> Float) -> [Float] { var result: [Float] = [] for i in a.indices { result.append(operation(a[i], b[i])) @@ -17,7 +17,7 @@ internal func zipMap(a: [Float], _ b: [Float], operation: (Float, Float) -> Floa return result } -internal func zipMapRepeat(a: [Float], _ infiniteB: [Float], operation: (Float, Float) -> Float) -> [Float] { +internal func zipMapRepeat(_ a: [Float], _ infiniteB: [Float], operation: (Float, Float) -> Float) -> [Float] { var result: [Float] = [] for i in a.indices { result.append(operation(a[i], infiniteB[i % infiniteB.count])) diff --git a/TensorSwiftTests/CalculationPerformanceTests.swift b/TensorSwiftTests/CalculationPerformanceTests.swift index 68b166d..f37bc08 100644 --- a/TensorSwiftTests/CalculationPerformanceTests.swift +++ b/TensorSwiftTests/CalculationPerformanceTests.swift @@ -2,19 +2,19 @@ import XCTest @testable import TensorSwift private func getTensor1000x1000() -> Tensor { - let elements = [Float](count: 1000*1000 ,repeatedValue:0.1) + let elements = [Float](repeating: 0.1 ,count: 1000*1000) return Tensor(shape: [1000, 1000], elements: elements) } private func getTensor1x1000() -> Tensor { - let elements = [Float](count: 1000, repeatedValue: 0) + let elements = [Float](repeating: 0, count: 1000) return Tensor(shape: [1, 1000], elements: elements) } class CalculationPerformanceTest : XCTestCase { func testElementAccess(){ let W = getTensor1000x1000() - measureBlock{ + measure{ for _ in 0..<100000{ let _ = W[500,500] } @@ -23,7 +23,7 @@ class CalculationPerformanceTest : XCTestCase { func testElementAccessRaw(){ let W = getTensor1000x1000() - measureBlock{ + measure{ for _ in 0..<100000{ let _ = W.elements[500*W.shape.dimensions[1].value + 500] } @@ -34,7 +34,7 @@ class CalculationPerformanceTest : XCTestCase { let W = getTensor1000x1000() let x = getTensor1x1000() - measureBlock{ + measure{ let _ = x.matmul(W) } } @@ -43,11 +43,11 @@ class CalculationPerformanceTest : XCTestCase { let W = getTensor1000x1000() let x = getTensor1x1000() - measureBlock{ + measure{ let xRow = x.shape.dimensions[0].value let WRow = W.shape.dimensions[0].value let WColumn = W.shape.dimensions[1].value - var elements = [Float](count: 1000, repeatedValue: 0) + var elements = [Float](repeating: 0, count: 1000) for r in 0.. Date: Tue, 27 Sep 2016 12:12:40 +0900 Subject: [PATCH 02/26] Support SPM. --- .gitignore | 7 + Package.swift | 5 + {TensorSwift => Sources}/Dimension.swift | 0 {TensorSwift => Sources}/Info.plist | 0 {TensorSwift => Sources}/Operators.swift | 0 {TensorSwift => Sources}/Shape.swift | 0 {TensorSwift => Sources}/Tensor.swift | 0 {TensorSwift => Sources}/TensorMath.swift | 0 {TensorSwift => Sources}/TensorNN.swift | 0 {TensorSwift => Sources}/TensorSwift.h | 0 {TensorSwift => Sources}/Utils.swift | 0 .../Configs/Project.xcconfig | 7 + .../TensorSwiftTests_Info.plist | 25 + TensorSwift.xcodeproj/TensorSwift_Info.plist | 25 + TensorSwift.xcodeproj/project.pbxproj | 1394 +++-------------- .../contents.xcworkspacedata | 2 +- .../xcshareddata/TensorSwift.xcscmblueprint | 30 - .../xcschemes/TensorSwift-OSX.xcscheme | 99 -- .../xcschemes/TensorSwift-iOS.xcscheme | 99 -- Tests/LinuxMain.swift | 6 + .../CalculationPerformanceTests.swift | 0 .../TensorSwiftTests}/DimensionTest.swift | 0 .../TensorSwiftTests}/Info.plist | 0 .../TensorSwiftTests}/PowerTest.swift | 0 .../TensorSwiftTests}/TensorNNTest.swift | 0 .../TensorSwiftTests}/TensorSwiftSample.swift | 0 .../TensorSwiftTests}/TensorTest.swift | 0 27 files changed, 262 insertions(+), 1437 deletions(-) create mode 100644 Package.swift rename {TensorSwift => Sources}/Dimension.swift (100%) rename {TensorSwift => Sources}/Info.plist (100%) rename {TensorSwift => Sources}/Operators.swift (100%) rename {TensorSwift => Sources}/Shape.swift (100%) rename {TensorSwift => Sources}/Tensor.swift (100%) rename {TensorSwift => Sources}/TensorMath.swift (100%) rename {TensorSwift => Sources}/TensorNN.swift (100%) rename {TensorSwift => Sources}/TensorSwift.h (100%) rename {TensorSwift => Sources}/Utils.swift (100%) create mode 100644 TensorSwift.xcodeproj/Configs/Project.xcconfig create mode 100644 TensorSwift.xcodeproj/TensorSwiftTests_Info.plist create mode 100644 TensorSwift.xcodeproj/TensorSwift_Info.plist delete mode 100644 TensorSwift.xcodeproj/project.xcworkspace/xcshareddata/TensorSwift.xcscmblueprint delete mode 100644 TensorSwift.xcodeproj/xcshareddata/xcschemes/TensorSwift-OSX.xcscheme delete mode 100644 TensorSwift.xcodeproj/xcshareddata/xcschemes/TensorSwift-iOS.xcscheme create mode 100644 Tests/LinuxMain.swift rename {TensorSwiftTests => Tests/TensorSwiftTests}/CalculationPerformanceTests.swift (100%) rename {TensorSwiftTests => Tests/TensorSwiftTests}/DimensionTest.swift (100%) rename {TensorSwiftTests => Tests/TensorSwiftTests}/Info.plist (100%) rename {TensorSwiftTests => Tests/TensorSwiftTests}/PowerTest.swift (100%) rename {TensorSwiftTests => Tests/TensorSwiftTests}/TensorNNTest.swift (100%) rename {TensorSwiftTests => Tests/TensorSwiftTests}/TensorSwiftSample.swift (100%) rename {TensorSwiftTests => Tests/TensorSwiftTests}/TensorTest.swift (100%) diff --git a/.gitignore b/.gitignore index 8615121..db75dd2 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,13 @@ DerivedData *.ipa *.xcuserstate +# SwiftPackageManager +# +.build +/*.xcodeproj/xcshareddata/ +/*.xcodeproj/project.xcworkspace/xcuserdata/ +/*.xcodeproj/xcuserdata/ + # CocoaPods # # We recommend against adding the Pods directory to your .gitignore. However diff --git a/Package.swift b/Package.swift new file mode 100644 index 0000000..be3ad23 --- /dev/null +++ b/Package.swift @@ -0,0 +1,5 @@ +import PackageDescription + +let package = Package( + name: "TensorSwift" +) diff --git a/TensorSwift/Dimension.swift b/Sources/Dimension.swift similarity index 100% rename from TensorSwift/Dimension.swift rename to Sources/Dimension.swift diff --git a/TensorSwift/Info.plist b/Sources/Info.plist similarity index 100% rename from TensorSwift/Info.plist rename to Sources/Info.plist diff --git a/TensorSwift/Operators.swift b/Sources/Operators.swift similarity index 100% rename from TensorSwift/Operators.swift rename to Sources/Operators.swift diff --git a/TensorSwift/Shape.swift b/Sources/Shape.swift similarity index 100% rename from TensorSwift/Shape.swift rename to Sources/Shape.swift diff --git a/TensorSwift/Tensor.swift b/Sources/Tensor.swift similarity index 100% rename from TensorSwift/Tensor.swift rename to Sources/Tensor.swift diff --git a/TensorSwift/TensorMath.swift b/Sources/TensorMath.swift similarity index 100% rename from TensorSwift/TensorMath.swift rename to Sources/TensorMath.swift diff --git a/TensorSwift/TensorNN.swift b/Sources/TensorNN.swift similarity index 100% rename from TensorSwift/TensorNN.swift rename to Sources/TensorNN.swift diff --git a/TensorSwift/TensorSwift.h b/Sources/TensorSwift.h similarity index 100% rename from TensorSwift/TensorSwift.h rename to Sources/TensorSwift.h diff --git a/TensorSwift/Utils.swift b/Sources/Utils.swift similarity index 100% rename from TensorSwift/Utils.swift rename to Sources/Utils.swift diff --git a/TensorSwift.xcodeproj/Configs/Project.xcconfig b/TensorSwift.xcodeproj/Configs/Project.xcconfig new file mode 100644 index 0000000..5f63024 --- /dev/null +++ b/TensorSwift.xcodeproj/Configs/Project.xcconfig @@ -0,0 +1,7 @@ +PRODUCT_NAME = $(TARGET_NAME) +SUPPORTED_PLATFORMS = macosx iphoneos iphonesimulator appletvos appletvsimulator watchos watchsimulator +MACOSX_DEPLOYMENT_TARGET = 10.10 +DYLIB_INSTALL_NAME_BASE = @rpath +OTHER_SWIFT_FLAGS = -DXcode +COMBINE_HIDPI_IMAGES = YES +USE_HEADERMAP = NO diff --git a/TensorSwift.xcodeproj/TensorSwiftTests_Info.plist b/TensorSwift.xcodeproj/TensorSwiftTests_Info.plist new file mode 100644 index 0000000..7c23420 --- /dev/null +++ b/TensorSwift.xcodeproj/TensorSwiftTests_Info.plist @@ -0,0 +1,25 @@ + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSPrincipalClass + + + diff --git a/TensorSwift.xcodeproj/TensorSwift_Info.plist b/TensorSwift.xcodeproj/TensorSwift_Info.plist new file mode 100644 index 0000000..57ada9f --- /dev/null +++ b/TensorSwift.xcodeproj/TensorSwift_Info.plist @@ -0,0 +1,25 @@ + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSPrincipalClass + + + diff --git a/TensorSwift.xcodeproj/project.pbxproj b/TensorSwift.xcodeproj/project.pbxproj index e236ed3..1d54e5c 100644 --- a/TensorSwift.xcodeproj/project.pbxproj +++ b/TensorSwift.xcodeproj/project.pbxproj @@ -7,1388 +7,366 @@ objects = { /* Begin PBXBuildFile section */ - 273614FA1CB3E72200CF4935 /* SHA1.swift in Sources */ = {isa = PBXBuildFile; fileRef = 273614F91CB3E72200CF4935 /* SHA1.swift */; }; - A7DF6CC61D9924C30097CEB7 /* PowerTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7DF6CC51D9924C30097CEB7 /* PowerTest.swift */; }; - A7E021DB1CAA4B2F00BAFC54 /* CalculationPerformanceTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7E021DA1CAA4B2F00BAFC54 /* CalculationPerformanceTests.swift */; }; - D6312E411CE33BB700985B92 /* Classifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = D6312E401CE33BB700985B92 /* Classifier.swift */; }; - D6312E431CE4341500985B92 /* ClassifierTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = D6312E421CE4341500985B92 /* ClassifierTest.swift */; }; - D6312E451CE4351100985B92 /* String.swift in Sources */ = {isa = PBXBuildFile; fileRef = D6312E441CE4351100985B92 /* String.swift */; }; - D6312E4F1CE4397500985B92 /* b_conv1 in Resources */ = {isa = PBXBuildFile; fileRef = D6312E471CE4397500985B92 /* b_conv1 */; }; - D6312E501CE4397500985B92 /* b_conv1 in Resources */ = {isa = PBXBuildFile; fileRef = D6312E471CE4397500985B92 /* b_conv1 */; }; - D6312E511CE4397500985B92 /* b_conv2 in Resources */ = {isa = PBXBuildFile; fileRef = D6312E481CE4397500985B92 /* b_conv2 */; }; - D6312E521CE4397500985B92 /* b_conv2 in Resources */ = {isa = PBXBuildFile; fileRef = D6312E481CE4397500985B92 /* b_conv2 */; }; - D6312E531CE4397500985B92 /* b_fc1 in Resources */ = {isa = PBXBuildFile; fileRef = D6312E491CE4397500985B92 /* b_fc1 */; }; - D6312E541CE4397500985B92 /* b_fc1 in Resources */ = {isa = PBXBuildFile; fileRef = D6312E491CE4397500985B92 /* b_fc1 */; }; - D6312E551CE4397500985B92 /* b_fc2 in Resources */ = {isa = PBXBuildFile; fileRef = D6312E4A1CE4397500985B92 /* b_fc2 */; }; - D6312E561CE4397500985B92 /* b_fc2 in Resources */ = {isa = PBXBuildFile; fileRef = D6312E4A1CE4397500985B92 /* b_fc2 */; }; - D6312E571CE4397500985B92 /* W_conv1 in Resources */ = {isa = PBXBuildFile; fileRef = D6312E4B1CE4397500985B92 /* W_conv1 */; }; - D6312E581CE4397500985B92 /* W_conv1 in Resources */ = {isa = PBXBuildFile; fileRef = D6312E4B1CE4397500985B92 /* W_conv1 */; }; - D6312E591CE4397500985B92 /* W_conv2 in Resources */ = {isa = PBXBuildFile; fileRef = D6312E4C1CE4397500985B92 /* W_conv2 */; }; - D6312E5A1CE4397500985B92 /* W_conv2 in Resources */ = {isa = PBXBuildFile; fileRef = D6312E4C1CE4397500985B92 /* W_conv2 */; }; - D6312E5B1CE4397500985B92 /* W_fc1 in Resources */ = {isa = PBXBuildFile; fileRef = D6312E4D1CE4397500985B92 /* W_fc1 */; }; - D6312E5C1CE4397500985B92 /* W_fc1 in Resources */ = {isa = PBXBuildFile; fileRef = D6312E4D1CE4397500985B92 /* W_fc1 */; }; - D6312E5D1CE4397500985B92 /* W_fc2 in Resources */ = {isa = PBXBuildFile; fileRef = D6312E4E1CE4397500985B92 /* W_fc2 */; }; - D6312E5E1CE4397500985B92 /* W_fc2 in Resources */ = {isa = PBXBuildFile; fileRef = D6312E4E1CE4397500985B92 /* W_fc2 */; }; - D6312E631CE4699D00985B92 /* Array.swift in Sources */ = {isa = PBXBuildFile; fileRef = D6312E621CE4699D00985B92 /* Array.swift */; }; - D6312E641CE46BDE00985B92 /* TensorSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D69C33E51C8D731C007985D4 /* TensorSwift.framework */; }; - D6312E651CE46BDE00985B92 /* TensorSwift.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = D69C33E51C8D731C007985D4 /* TensorSwift.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - D6312E6A1CE484FE00985B92 /* Line.swift in Sources */ = {isa = PBXBuildFile; fileRef = D6312E691CE484FE00985B92 /* Line.swift */; }; - D6312E6C1CE4852800985B92 /* Canvas.swift in Sources */ = {isa = PBXBuildFile; fileRef = D6312E6B1CE4852800985B92 /* Canvas.swift */; }; - D6312E6E1CE486A700985B92 /* CanvasView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D6312E6D1CE486A700985B92 /* CanvasView.swift */; }; - D6312E701CE5D7BB00985B92 /* DimensionTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = D6312E6F1CE5D7BB00985B92 /* DimensionTest.swift */; }; - D63F30041C996F4100B88E12 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D63F30031C996F4100B88E12 /* AppDelegate.swift */; }; - D63F30061C996F4100B88E12 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D63F30051C996F4100B88E12 /* ViewController.swift */; }; - D63F30091C996F4200B88E12 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D63F30071C996F4200B88E12 /* Main.storyboard */; }; - D63F300B1C996F4200B88E12 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D63F300A1C996F4200B88E12 /* Assets.xcassets */; }; - D63F300E1C996F4200B88E12 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D63F300C1C996F4200B88E12 /* LaunchScreen.storyboard */; }; - D63F30191C996F4200B88E12 /* MNISTTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = D63F30181C996F4200B88E12 /* MNISTTest.swift */; }; - D66E2A931CCDD3C700859630 /* Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = D66E2A921CCDD3C700859630 /* Utils.swift */; }; - D69C33E91C8D731C007985D4 /* TensorSwift.h in Headers */ = {isa = PBXBuildFile; fileRef = D69C33E81C8D731C007985D4 /* TensorSwift.h */; settings = {ATTRIBUTES = (Public, ); }; }; - D69C33F01C8D731C007985D4 /* TensorSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D69C33E51C8D731C007985D4 /* TensorSwift.framework */; }; - D69C33F51C8D731C007985D4 /* TensorTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = D69C33F41C8D731C007985D4 /* TensorTest.swift */; }; - D69C34001C8D735C007985D4 /* Tensor.swift in Sources */ = {isa = PBXBuildFile; fileRef = D69C33FF1C8D735C007985D4 /* Tensor.swift */; }; - D69C34021C8D7435007985D4 /* Shape.swift in Sources */ = {isa = PBXBuildFile; fileRef = D69C34011C8D7435007985D4 /* Shape.swift */; }; - D69C34041C8D7487007985D4 /* Dimension.swift in Sources */ = {isa = PBXBuildFile; fileRef = D69C34031C8D7487007985D4 /* Dimension.swift */; }; - D69C34061C8D8F87007985D4 /* TensorSwiftSample.swift in Sources */ = {isa = PBXBuildFile; fileRef = D69C34051C8D8F87007985D4 /* TensorSwiftSample.swift */; }; - D69C34081C8E7D03007985D4 /* Operators.swift in Sources */ = {isa = PBXBuildFile; fileRef = D69C34071C8E7D03007985D4 /* Operators.swift */; }; - D69C340A1C8E7D44007985D4 /* TensorMath.swift in Sources */ = {isa = PBXBuildFile; fileRef = D69C34091C8E7D44007985D4 /* TensorMath.swift */; }; - D69C340C1C8E85D0007985D4 /* TensorNN.swift in Sources */ = {isa = PBXBuildFile; fileRef = D69C340B1C8E85D0007985D4 /* TensorNN.swift */; }; - D69C34111C8ED4FD007985D4 /* TensorNNTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = D69C34101C8ED4FC007985D4 /* TensorNNTest.swift */; }; - D6CE6C8D1CEED6F8004EAAE9 /* TensorSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D6CE6C831CEED6F7004EAAE9 /* TensorSwift.framework */; }; - D6CE6CA91CEED72F004EAAE9 /* TensorSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D6CE6C9F1CEED72F004EAAE9 /* TensorSwift.framework */; }; - D6CE6CC31CEED89B004EAAE9 /* TensorSwift.h in Headers */ = {isa = PBXBuildFile; fileRef = D69C33E81C8D731C007985D4 /* TensorSwift.h */; settings = {ATTRIBUTES = (Public, ); }; }; - D6CE6CC41CEED89B004EAAE9 /* Tensor.swift in Sources */ = {isa = PBXBuildFile; fileRef = D69C33FF1C8D735C007985D4 /* Tensor.swift */; }; - D6CE6CC51CEED89B004EAAE9 /* TensorMath.swift in Sources */ = {isa = PBXBuildFile; fileRef = D69C34091C8E7D44007985D4 /* TensorMath.swift */; }; - D6CE6CC61CEED89B004EAAE9 /* TensorNN.swift in Sources */ = {isa = PBXBuildFile; fileRef = D69C340B1C8E85D0007985D4 /* TensorNN.swift */; }; - D6CE6CC71CEED89B004EAAE9 /* Shape.swift in Sources */ = {isa = PBXBuildFile; fileRef = D69C34011C8D7435007985D4 /* Shape.swift */; }; - D6CE6CC81CEED89B004EAAE9 /* Dimension.swift in Sources */ = {isa = PBXBuildFile; fileRef = D69C34031C8D7487007985D4 /* Dimension.swift */; }; - D6CE6CC91CEED89B004EAAE9 /* Operators.swift in Sources */ = {isa = PBXBuildFile; fileRef = D69C34071C8E7D03007985D4 /* Operators.swift */; }; - D6CE6CCA1CEED89B004EAAE9 /* Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = D66E2A921CCDD3C700859630 /* Utils.swift */; }; - D6CE6CCB1CEED89C004EAAE9 /* TensorSwift.h in Headers */ = {isa = PBXBuildFile; fileRef = D69C33E81C8D731C007985D4 /* TensorSwift.h */; settings = {ATTRIBUTES = (Public, ); }; }; - D6CE6CCC1CEED89C004EAAE9 /* Tensor.swift in Sources */ = {isa = PBXBuildFile; fileRef = D69C33FF1C8D735C007985D4 /* Tensor.swift */; }; - D6CE6CCD1CEED89C004EAAE9 /* TensorMath.swift in Sources */ = {isa = PBXBuildFile; fileRef = D69C34091C8E7D44007985D4 /* TensorMath.swift */; }; - D6CE6CCE1CEED89C004EAAE9 /* TensorNN.swift in Sources */ = {isa = PBXBuildFile; fileRef = D69C340B1C8E85D0007985D4 /* TensorNN.swift */; }; - D6CE6CCF1CEED89C004EAAE9 /* Shape.swift in Sources */ = {isa = PBXBuildFile; fileRef = D69C34011C8D7435007985D4 /* Shape.swift */; }; - D6CE6CD01CEED89C004EAAE9 /* Dimension.swift in Sources */ = {isa = PBXBuildFile; fileRef = D69C34031C8D7487007985D4 /* Dimension.swift */; }; - D6CE6CD11CEED89C004EAAE9 /* Operators.swift in Sources */ = {isa = PBXBuildFile; fileRef = D69C34071C8E7D03007985D4 /* Operators.swift */; }; - D6CE6CD21CEED89C004EAAE9 /* Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = D66E2A921CCDD3C700859630 /* Utils.swift */; }; - D6CE6CD31CEED89D004EAAE9 /* TensorSwift.h in Headers */ = {isa = PBXBuildFile; fileRef = D69C33E81C8D731C007985D4 /* TensorSwift.h */; settings = {ATTRIBUTES = (Public, ); }; }; - D6CE6CD41CEED89D004EAAE9 /* Tensor.swift in Sources */ = {isa = PBXBuildFile; fileRef = D69C33FF1C8D735C007985D4 /* Tensor.swift */; }; - D6CE6CD51CEED89D004EAAE9 /* TensorMath.swift in Sources */ = {isa = PBXBuildFile; fileRef = D69C34091C8E7D44007985D4 /* TensorMath.swift */; }; - D6CE6CD61CEED89D004EAAE9 /* TensorNN.swift in Sources */ = {isa = PBXBuildFile; fileRef = D69C340B1C8E85D0007985D4 /* TensorNN.swift */; }; - D6CE6CD71CEED89D004EAAE9 /* Shape.swift in Sources */ = {isa = PBXBuildFile; fileRef = D69C34011C8D7435007985D4 /* Shape.swift */; }; - D6CE6CD81CEED89D004EAAE9 /* Dimension.swift in Sources */ = {isa = PBXBuildFile; fileRef = D69C34031C8D7487007985D4 /* Dimension.swift */; }; - D6CE6CD91CEED89D004EAAE9 /* Operators.swift in Sources */ = {isa = PBXBuildFile; fileRef = D69C34071C8E7D03007985D4 /* Operators.swift */; }; - D6CE6CDA1CEED89D004EAAE9 /* Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = D66E2A921CCDD3C700859630 /* Utils.swift */; }; - D6CE6CDB1CEED8AD004EAAE9 /* TensorTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = D69C33F41C8D731C007985D4 /* TensorTest.swift */; }; - D6CE6CDC1CEED8AD004EAAE9 /* TensorNNTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = D69C34101C8ED4FC007985D4 /* TensorNNTest.swift */; }; - D6CE6CDD1CEED8AD004EAAE9 /* DimensionTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = D6312E6F1CE5D7BB00985B92 /* DimensionTest.swift */; }; - D6CE6CDE1CEED8AD004EAAE9 /* CalculationPerformanceTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7E021DA1CAA4B2F00BAFC54 /* CalculationPerformanceTests.swift */; }; - D6CE6CDF1CEED8AD004EAAE9 /* TensorSwiftSample.swift in Sources */ = {isa = PBXBuildFile; fileRef = D69C34051C8D8F87007985D4 /* TensorSwiftSample.swift */; }; - D6CE6CE01CEED8AF004EAAE9 /* TensorTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = D69C33F41C8D731C007985D4 /* TensorTest.swift */; }; - D6CE6CE11CEED8AF004EAAE9 /* TensorNNTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = D69C34101C8ED4FC007985D4 /* TensorNNTest.swift */; }; - D6CE6CE21CEED8AF004EAAE9 /* DimensionTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = D6312E6F1CE5D7BB00985B92 /* DimensionTest.swift */; }; - D6CE6CE31CEED8AF004EAAE9 /* CalculationPerformanceTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7E021DA1CAA4B2F00BAFC54 /* CalculationPerformanceTests.swift */; }; - D6CE6CE41CEED8AF004EAAE9 /* TensorSwiftSample.swift in Sources */ = {isa = PBXBuildFile; fileRef = D69C34051C8D8F87007985D4 /* TensorSwiftSample.swift */; }; - D6D5D4BA1CA24E7C0041BE85 /* Downloader.swift in Sources */ = {isa = PBXBuildFile; fileRef = D6D5D4B91CA24E7C0041BE85 /* Downloader.swift */; }; - D6F63B0D1CB7593000F3C82E /* DownloaderTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = D6F63B0C1CB7593000F3C82E /* DownloaderTest.swift */; }; - D6F63B131CB75E8700F3C82E /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = D6F63B121CB75E8700F3C82E /* libz.tbd */; }; + _LinkFileRef_TensorSwift_via_TensorSwiftTests /* TensorSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = "_____Product_TensorSwift" /* TensorSwift.framework */; }; + __src_cc_ref_Sources/Dimension.swift /* Dimension.swift in Sources */ = {isa = PBXBuildFile; fileRef = __PBXFileRef_Sources/Dimension.swift /* Dimension.swift */; }; + __src_cc_ref_Sources/Operators.swift /* Operators.swift in Sources */ = {isa = PBXBuildFile; fileRef = __PBXFileRef_Sources/Operators.swift /* Operators.swift */; }; + __src_cc_ref_Sources/Shape.swift /* Shape.swift in Sources */ = {isa = PBXBuildFile; fileRef = __PBXFileRef_Sources/Shape.swift /* Shape.swift */; }; + __src_cc_ref_Sources/Tensor.swift /* Tensor.swift in Sources */ = {isa = PBXBuildFile; fileRef = __PBXFileRef_Sources/Tensor.swift /* Tensor.swift */; }; + __src_cc_ref_Sources/TensorMath.swift /* TensorMath.swift in Sources */ = {isa = PBXBuildFile; fileRef = __PBXFileRef_Sources/TensorMath.swift /* TensorMath.swift */; }; + __src_cc_ref_Sources/TensorNN.swift /* TensorNN.swift in Sources */ = {isa = PBXBuildFile; fileRef = __PBXFileRef_Sources/TensorNN.swift /* TensorNN.swift */; }; + __src_cc_ref_Sources/Utils.swift /* Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = __PBXFileRef_Sources/Utils.swift /* Utils.swift */; }; + __src_cc_ref_Tests/TensorSwiftTests/CalculationPerformanceTests.swift /* CalculationPerformanceTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = __PBXFileRef_Tests/TensorSwiftTests/CalculationPerformanceTests.swift /* CalculationPerformanceTests.swift */; }; + __src_cc_ref_Tests/TensorSwiftTests/DimensionTest.swift /* DimensionTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = __PBXFileRef_Tests/TensorSwiftTests/DimensionTest.swift /* DimensionTest.swift */; }; + __src_cc_ref_Tests/TensorSwiftTests/PowerTest.swift /* PowerTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = __PBXFileRef_Tests/TensorSwiftTests/PowerTest.swift /* PowerTest.swift */; }; + __src_cc_ref_Tests/TensorSwiftTests/TensorNNTest.swift /* TensorNNTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = __PBXFileRef_Tests/TensorSwiftTests/TensorNNTest.swift /* TensorNNTest.swift */; }; + __src_cc_ref_Tests/TensorSwiftTests/TensorSwiftSample.swift /* TensorSwiftSample.swift in Sources */ = {isa = PBXBuildFile; fileRef = __PBXFileRef_Tests/TensorSwiftTests/TensorSwiftSample.swift /* TensorSwiftSample.swift */; }; + __src_cc_ref_Tests/TensorSwiftTests/TensorTest.swift /* TensorTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = __PBXFileRef_Tests/TensorSwiftTests/TensorTest.swift /* TensorTest.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - D6312E661CE46BDE00985B92 /* PBXContainerItemProxy */ = { + A7DF6EB61D9A1AC40097CEB7 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = D69C33DC1C8D731C007985D4 /* Project object */; + containerPortal = __RootObject_ /* Project object */; proxyType = 1; - remoteGlobalIDString = D69C33E41C8D731C007985D4; + remoteGlobalIDString = "______Target_TensorSwift"; remoteInfo = TensorSwift; }; - D63F30151C996F4200B88E12 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D69C33DC1C8D731C007985D4 /* Project object */; - proxyType = 1; - remoteGlobalIDString = D63F30001C996F4100B88E12; - remoteInfo = MNIST; - }; - D69C33F11C8D731C007985D4 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D69C33DC1C8D731C007985D4 /* Project object */; - proxyType = 1; - remoteGlobalIDString = D69C33E41C8D731C007985D4; - remoteInfo = TensorSwift; - }; - D6CE6C8E1CEED6F8004EAAE9 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D69C33DC1C8D731C007985D4 /* Project object */; - proxyType = 1; - remoteGlobalIDString = D6CE6C821CEED6F7004EAAE9; - remoteInfo = "TensorSwift-OSX"; - }; - D6CE6CAA1CEED72F004EAAE9 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D69C33DC1C8D731C007985D4 /* Project object */; - proxyType = 1; - remoteGlobalIDString = D6CE6C9E1CEED72F004EAAE9; - remoteInfo = "TensorSwift-tvOS"; - }; /* End PBXContainerItemProxy section */ -/* Begin PBXCopyFilesBuildPhase section */ - D6312E681CE46BDE00985B92 /* Embed Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - D6312E651CE46BDE00985B92 /* TensorSwift.framework in Embed Frameworks */, - ); - name = "Embed Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - /* Begin PBXFileReference section */ - 273614F91CB3E72200CF4935 /* SHA1.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SHA1.swift; sourceTree = ""; }; - 273614FC1CB3E81B00CF4935 /* MNISTTests-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "MNISTTests-Bridging-Header.h"; sourceTree = ""; }; - A7DF6CC51D9924C30097CEB7 /* PowerTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PowerTest.swift; sourceTree = ""; }; - A7E021DA1CAA4B2F00BAFC54 /* CalculationPerformanceTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CalculationPerformanceTests.swift; sourceTree = ""; }; - D6312E401CE33BB700985B92 /* Classifier.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Classifier.swift; sourceTree = ""; }; - D6312E421CE4341500985B92 /* ClassifierTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ClassifierTest.swift; sourceTree = ""; }; - D6312E441CE4351100985B92 /* String.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = String.swift; sourceTree = ""; }; - D6312E471CE4397500985B92 /* b_conv1 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = b_conv1; sourceTree = ""; }; - D6312E481CE4397500985B92 /* b_conv2 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = b_conv2; sourceTree = ""; }; - D6312E491CE4397500985B92 /* b_fc1 */ = {isa = PBXFileReference; lastKnownFileType = file; path = b_fc1; sourceTree = ""; }; - D6312E4A1CE4397500985B92 /* b_fc2 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = b_fc2; sourceTree = ""; }; - D6312E4B1CE4397500985B92 /* W_conv1 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = W_conv1; sourceTree = ""; }; - D6312E4C1CE4397500985B92 /* W_conv2 */ = {isa = PBXFileReference; lastKnownFileType = file; path = W_conv2; sourceTree = ""; }; - D6312E4D1CE4397500985B92 /* W_fc1 */ = {isa = PBXFileReference; lastKnownFileType = file; path = W_fc1; sourceTree = ""; }; - D6312E4E1CE4397500985B92 /* W_fc2 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = W_fc2; sourceTree = ""; }; - D6312E621CE4699D00985B92 /* Array.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Array.swift; sourceTree = ""; }; - D6312E691CE484FE00985B92 /* Line.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Line.swift; sourceTree = ""; }; - D6312E6B1CE4852800985B92 /* Canvas.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Canvas.swift; sourceTree = ""; }; - D6312E6D1CE486A700985B92 /* CanvasView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CanvasView.swift; sourceTree = ""; }; - D6312E6F1CE5D7BB00985B92 /* DimensionTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DimensionTest.swift; sourceTree = ""; }; - D63F30011C996F4100B88E12 /* MNIST.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MNIST.app; sourceTree = BUILT_PRODUCTS_DIR; }; - D63F30031C996F4100B88E12 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - D63F30051C996F4100B88E12 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; - D63F30081C996F4200B88E12 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - D63F300A1C996F4200B88E12 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - D63F300D1C996F4200B88E12 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - D63F300F1C996F4200B88E12 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - D63F30141C996F4200B88E12 /* MNISTTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MNISTTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - D63F30181C996F4200B88E12 /* MNISTTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MNISTTest.swift; sourceTree = ""; }; - D63F301A1C996F4200B88E12 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - D66E2A921CCDD3C700859630 /* Utils.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Utils.swift; sourceTree = ""; }; - D69C33E51C8D731C007985D4 /* TensorSwift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = TensorSwift.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - D69C33E81C8D731C007985D4 /* TensorSwift.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TensorSwift.h; sourceTree = ""; }; - D69C33EA1C8D731C007985D4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - D69C33EF1C8D731C007985D4 /* TensorSwiftTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TensorSwiftTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - D69C33F41C8D731C007985D4 /* TensorTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TensorTest.swift; sourceTree = ""; }; - D69C33F61C8D731C007985D4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - D69C33FF1C8D735C007985D4 /* Tensor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Tensor.swift; sourceTree = ""; }; - D69C34011C8D7435007985D4 /* Shape.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Shape.swift; sourceTree = ""; }; - D69C34031C8D7487007985D4 /* Dimension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Dimension.swift; sourceTree = ""; }; - D69C34051C8D8F87007985D4 /* TensorSwiftSample.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TensorSwiftSample.swift; sourceTree = ""; }; - D69C34071C8E7D03007985D4 /* Operators.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Operators.swift; sourceTree = ""; }; - D69C34091C8E7D44007985D4 /* TensorMath.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TensorMath.swift; sourceTree = ""; }; - D69C340B1C8E85D0007985D4 /* TensorNN.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TensorNN.swift; sourceTree = ""; }; - D69C34101C8ED4FC007985D4 /* TensorNNTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TensorNNTest.swift; sourceTree = ""; }; - D6CE6C831CEED6F7004EAAE9 /* TensorSwift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = TensorSwift.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - D6CE6C8C1CEED6F8004EAAE9 /* TensorSwiftTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TensorSwiftTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - D6CE6C9F1CEED72F004EAAE9 /* TensorSwift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = TensorSwift.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - D6CE6CA81CEED72F004EAAE9 /* TensorSwiftTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TensorSwiftTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - D6CE6CBB1CEED740004EAAE9 /* TensorSwift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = TensorSwift.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - D6D5D4B91CA24E7C0041BE85 /* Downloader.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Downloader.swift; sourceTree = ""; }; - D6F63B0C1CB7593000F3C82E /* DownloaderTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DownloaderTest.swift; sourceTree = ""; }; - D6F63B121CB75E8700F3C82E /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; }; + __PBXFileRef_Package.swift /* Package.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Package.swift; sourceTree = ""; }; + __PBXFileRef_Resources /* Resources */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Resources; sourceTree = ""; }; + __PBXFileRef_Sources/Dimension.swift /* Dimension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Dimension.swift; sourceTree = ""; }; + __PBXFileRef_Sources/Operators.swift /* Operators.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Operators.swift; sourceTree = ""; }; + __PBXFileRef_Sources/Shape.swift /* Shape.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Shape.swift; sourceTree = ""; }; + __PBXFileRef_Sources/Tensor.swift /* Tensor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Tensor.swift; sourceTree = ""; }; + __PBXFileRef_Sources/TensorMath.swift /* TensorMath.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TensorMath.swift; sourceTree = ""; }; + __PBXFileRef_Sources/TensorNN.swift /* TensorNN.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TensorNN.swift; sourceTree = ""; }; + __PBXFileRef_Sources/Utils.swift /* Utils.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Utils.swift; sourceTree = ""; }; + __PBXFileRef_TensorSwift.xcodeproj/Configs/Project.xcconfig /* TensorSwift.xcodeproj/Configs/Project.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = TensorSwift.xcodeproj/Configs/Project.xcconfig; sourceTree = ""; }; + __PBXFileRef_TensorSwiftTests /* TensorSwiftTests */ = {isa = PBXFileReference; lastKnownFileType = folder; path = TensorSwiftTests; sourceTree = ""; }; + __PBXFileRef_Tests/TensorSwiftTests/CalculationPerformanceTests.swift /* CalculationPerformanceTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CalculationPerformanceTests.swift; sourceTree = ""; }; + __PBXFileRef_Tests/TensorSwiftTests/DimensionTest.swift /* DimensionTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DimensionTest.swift; sourceTree = ""; }; + __PBXFileRef_Tests/TensorSwiftTests/PowerTest.swift /* PowerTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PowerTest.swift; sourceTree = ""; }; + __PBXFileRef_Tests/TensorSwiftTests/TensorNNTest.swift /* TensorNNTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TensorNNTest.swift; sourceTree = ""; }; + __PBXFileRef_Tests/TensorSwiftTests/TensorSwiftSample.swift /* TensorSwiftSample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TensorSwiftSample.swift; sourceTree = ""; }; + __PBXFileRef_Tests/TensorSwiftTests/TensorTest.swift /* TensorTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TensorTest.swift; sourceTree = ""; }; + __PBXFileRef_zlib /* zlib */ = {isa = PBXFileReference; lastKnownFileType = folder; path = zlib; sourceTree = ""; }; + "_____Product_TensorSwift" /* TensorSwift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = TensorSwift.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + "_____Product_TensorSwiftTests" /* TensorSwiftTests.xctest */ = {isa = PBXFileReference; lastKnownFileType = file; path = TensorSwiftTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - D63F2FFE1C996F4100B88E12 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - D6312E641CE46BDE00985B92 /* TensorSwift.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - D63F30111C996F4200B88E12 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - D6F63B131CB75E8700F3C82E /* libz.tbd in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - D69C33E11C8D731C007985D4 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - D69C33EC1C8D731C007985D4 /* Frameworks */ = { + "___LinkPhase_TensorSwift" /* Frameworks */ = { isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; + buildActionMask = 0; files = ( - D69C33F01C8D731C007985D4 /* TensorSwift.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - D6CE6C7F1CEED6F7004EAAE9 /* Frameworks */ = { + "___LinkPhase_TensorSwiftTests" /* Frameworks */ = { isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - D6CE6C891CEED6F8004EAAE9 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - D6CE6C8D1CEED6F8004EAAE9 /* TensorSwift.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - D6CE6C9B1CEED72F004EAAE9 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - D6CE6CA51CEED72F004EAAE9 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - D6CE6CA91CEED72F004EAAE9 /* TensorSwift.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - D6CE6CB71CEED740004EAAE9 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; + buildActionMask = 0; files = ( + _LinkFileRef_TensorSwift_via_TensorSwiftTests /* TensorSwift.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - D6312E461CE4397500985B92 /* Models */ = { + TestProducts_ /* Tests */ = { isa = PBXGroup; children = ( - D6312E471CE4397500985B92 /* b_conv1 */, - D6312E481CE4397500985B92 /* b_conv2 */, - D6312E491CE4397500985B92 /* b_fc1 */, - D6312E4A1CE4397500985B92 /* b_fc2 */, - D6312E4B1CE4397500985B92 /* W_conv1 */, - D6312E4C1CE4397500985B92 /* W_conv2 */, - D6312E4D1CE4397500985B92 /* W_fc1 */, - D6312E4E1CE4397500985B92 /* W_fc2 */, + "_____Product_TensorSwiftTests" /* TensorSwiftTests.xctest */, ); - path = Models; + name = Tests; sourceTree = ""; }; - D63F30021C996F4100B88E12 /* MNIST */ = { + "___RootGroup_" = { isa = PBXGroup; children = ( - D63F30031C996F4100B88E12 /* AppDelegate.swift */, - D63F30051C996F4100B88E12 /* ViewController.swift */, - D6312E401CE33BB700985B92 /* Classifier.swift */, - D6312E441CE4351100985B92 /* String.swift */, - D6312E6D1CE486A700985B92 /* CanvasView.swift */, - D6312E691CE484FE00985B92 /* Line.swift */, - D6312E6B1CE4852800985B92 /* Canvas.swift */, - D63F30071C996F4200B88E12 /* Main.storyboard */, - D63F300A1C996F4200B88E12 /* Assets.xcassets */, - D63F300C1C996F4200B88E12 /* LaunchScreen.storyboard */, - D63F300F1C996F4200B88E12 /* Info.plist */, - D6312E461CE4397500985B92 /* Models */, + __PBXFileRef_Package.swift /* Package.swift */, + "_____Configs_" /* Configs */, + "_____Sources_" /* Sources */, + __PBXFileRef_Resources /* Resources */, + __PBXFileRef_TensorSwiftTests /* TensorSwiftTests */, + __PBXFileRef_zlib /* zlib */, + "_______Tests_" /* Tests */, + "____Products_" /* Products */, ); - path = MNIST; sourceTree = ""; }; - D63F30171C996F4200B88E12 /* MNISTTests */ = { + "____Products_" /* Products */ = { isa = PBXGroup; children = ( - D63F30181C996F4200B88E12 /* MNISTTest.swift */, - D6312E421CE4341500985B92 /* ClassifierTest.swift */, - D6F63B0C1CB7593000F3C82E /* DownloaderTest.swift */, - D6D5D4B91CA24E7C0041BE85 /* Downloader.swift */, - D6312E621CE4699D00985B92 /* Array.swift */, - 273614F91CB3E72200CF4935 /* SHA1.swift */, - 273614FC1CB3E81B00CF4935 /* MNISTTests-Bridging-Header.h */, - D63F301A1C996F4200B88E12 /* Info.plist */, + TestProducts_ /* Tests */, + "_____Product_TensorSwift" /* TensorSwift.framework */, ); - path = MNISTTests; + name = Products; sourceTree = ""; }; - D69C33DB1C8D731C007985D4 = { + "_____Configs_" /* Configs */ = { isa = PBXGroup; children = ( - D6F63B121CB75E8700F3C82E /* libz.tbd */, - D69C33E71C8D731C007985D4 /* TensorSwift */, - D69C33F31C8D731C007985D4 /* TensorSwiftTests */, - D63F30021C996F4100B88E12 /* MNIST */, - D63F30171C996F4200B88E12 /* MNISTTests */, - D69C33E61C8D731C007985D4 /* Products */, + __PBXFileRef_TensorSwift.xcodeproj/Configs/Project.xcconfig /* TensorSwift.xcodeproj/Configs/Project.xcconfig */, ); + name = Configs; sourceTree = ""; }; - D69C33E61C8D731C007985D4 /* Products */ = { + "_____Sources_" /* Sources */ = { isa = PBXGroup; children = ( - D69C33E51C8D731C007985D4 /* TensorSwift.framework */, - D69C33EF1C8D731C007985D4 /* TensorSwiftTests.xctest */, - D63F30011C996F4100B88E12 /* MNIST.app */, - D63F30141C996F4200B88E12 /* MNISTTests.xctest */, - D6CE6C831CEED6F7004EAAE9 /* TensorSwift.framework */, - D6CE6C8C1CEED6F8004EAAE9 /* TensorSwiftTests.xctest */, - D6CE6C9F1CEED72F004EAAE9 /* TensorSwift.framework */, - D6CE6CA81CEED72F004EAAE9 /* TensorSwiftTests.xctest */, - D6CE6CBB1CEED740004EAAE9 /* TensorSwift.framework */, + "_______Group_TensorSwift" /* TensorSwift */, ); - name = Products; + name = Sources; sourceTree = ""; }; - D69C33E71C8D731C007985D4 /* TensorSwift */ = { + "_______Group_TensorSwift" /* TensorSwift */ = { isa = PBXGroup; children = ( - D69C33E81C8D731C007985D4 /* TensorSwift.h */, - D69C33EA1C8D731C007985D4 /* Info.plist */, - D69C33FF1C8D735C007985D4 /* Tensor.swift */, - D69C34091C8E7D44007985D4 /* TensorMath.swift */, - D69C340B1C8E85D0007985D4 /* TensorNN.swift */, - D69C34011C8D7435007985D4 /* Shape.swift */, - D69C34031C8D7487007985D4 /* Dimension.swift */, - D69C34071C8E7D03007985D4 /* Operators.swift */, - D66E2A921CCDD3C700859630 /* Utils.swift */, - ); - path = TensorSwift; + __PBXFileRef_Sources/Dimension.swift /* Dimension.swift */, + __PBXFileRef_Sources/Operators.swift /* Operators.swift */, + __PBXFileRef_Sources/Shape.swift /* Shape.swift */, + __PBXFileRef_Sources/Tensor.swift /* Tensor.swift */, + __PBXFileRef_Sources/TensorMath.swift /* TensorMath.swift */, + __PBXFileRef_Sources/TensorNN.swift /* TensorNN.swift */, + __PBXFileRef_Sources/Utils.swift /* Utils.swift */, + ); + name = TensorSwift; + path = Sources; sourceTree = ""; }; - D69C33F31C8D731C007985D4 /* TensorSwiftTests */ = { + "_______Group_TensorSwiftTests" /* TensorSwiftTests */ = { isa = PBXGroup; children = ( - D69C33F41C8D731C007985D4 /* TensorTest.swift */, - D69C34101C8ED4FC007985D4 /* TensorNNTest.swift */, - D6312E6F1CE5D7BB00985B92 /* DimensionTest.swift */, - A7E021DA1CAA4B2F00BAFC54 /* CalculationPerformanceTests.swift */, - A7DF6CC51D9924C30097CEB7 /* PowerTest.swift */, - D69C34051C8D8F87007985D4 /* TensorSwiftSample.swift */, - D69C33F61C8D731C007985D4 /* Info.plist */, - ); - path = TensorSwiftTests; + __PBXFileRef_Tests/TensorSwiftTests/CalculationPerformanceTests.swift /* CalculationPerformanceTests.swift */, + __PBXFileRef_Tests/TensorSwiftTests/DimensionTest.swift /* DimensionTest.swift */, + __PBXFileRef_Tests/TensorSwiftTests/PowerTest.swift /* PowerTest.swift */, + __PBXFileRef_Tests/TensorSwiftTests/TensorNNTest.swift /* TensorNNTest.swift */, + __PBXFileRef_Tests/TensorSwiftTests/TensorSwiftSample.swift /* TensorSwiftSample.swift */, + __PBXFileRef_Tests/TensorSwiftTests/TensorTest.swift /* TensorTest.swift */, + ); + name = TensorSwiftTests; + path = Tests/TensorSwiftTests; sourceTree = ""; }; -/* End PBXGroup section */ - -/* Begin PBXHeadersBuildPhase section */ - D69C33E21C8D731C007985D4 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - D69C33E91C8D731C007985D4 /* TensorSwift.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - D6CE6C801CEED6F7004EAAE9 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - D6CE6CC31CEED89B004EAAE9 /* TensorSwift.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - D6CE6C9C1CEED72F004EAAE9 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - D6CE6CCB1CEED89C004EAAE9 /* TensorSwift.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - D6CE6CB81CEED740004EAAE9 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - D6CE6CD31CEED89D004EAAE9 /* TensorSwift.h in Headers */, + "_______Tests_" /* Tests */ = { + isa = PBXGroup; + children = ( + "_______Group_TensorSwiftTests" /* TensorSwiftTests */, ); - runOnlyForDeploymentPostprocessing = 0; + name = Tests; + sourceTree = ""; }; -/* End PBXHeadersBuildPhase section */ +/* End PBXGroup section */ /* Begin PBXNativeTarget section */ - D63F30001C996F4100B88E12 /* MNIST */ = { + "______Target_TensorSwift" /* TensorSwift */ = { isa = PBXNativeTarget; - buildConfigurationList = D63F301F1C996F4200B88E12 /* Build configuration list for PBXNativeTarget "MNIST" */; + buildConfigurationList = "_______Confs_TensorSwift" /* Build configuration list for PBXNativeTarget "TensorSwift" */; buildPhases = ( - D63F2FFD1C996F4100B88E12 /* Sources */, - D63F2FFE1C996F4100B88E12 /* Frameworks */, - D63F2FFF1C996F4100B88E12 /* Resources */, - D6312E681CE46BDE00985B92 /* Embed Frameworks */, + CompilePhase_TensorSwift /* Sources */, + "___LinkPhase_TensorSwift" /* Frameworks */, ); buildRules = ( ); dependencies = ( - D6312E671CE46BDE00985B92 /* PBXTargetDependency */, ); - name = MNIST; - productName = MNIST; - productReference = D63F30011C996F4100B88E12 /* MNIST.app */; - productType = "com.apple.product-type.application"; - }; - D63F30131C996F4200B88E12 /* MNISTTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = D63F30201C996F4200B88E12 /* Build configuration list for PBXNativeTarget "MNISTTests" */; - buildPhases = ( - D63F30101C996F4200B88E12 /* Sources */, - D63F30111C996F4200B88E12 /* Frameworks */, - D63F30121C996F4200B88E12 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - D63F30161C996F4200B88E12 /* PBXTargetDependency */, - ); - name = MNISTTests; - productName = MNISTTests; - productReference = D63F30141C996F4200B88E12 /* MNISTTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; - D69C33E41C8D731C007985D4 /* TensorSwift-iOS */ = { - isa = PBXNativeTarget; - buildConfigurationList = D69C33F91C8D731C007985D4 /* Build configuration list for PBXNativeTarget "TensorSwift-iOS" */; - buildPhases = ( - D69C33E01C8D731C007985D4 /* Sources */, - D69C33E11C8D731C007985D4 /* Frameworks */, - D69C33E21C8D731C007985D4 /* Headers */, - D69C33E31C8D731C007985D4 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = "TensorSwift-iOS"; + name = TensorSwift; productName = TensorSwift; - productReference = D69C33E51C8D731C007985D4 /* TensorSwift.framework */; + productReference = "_____Product_TensorSwift" /* TensorSwift.framework */; productType = "com.apple.product-type.framework"; }; - D69C33EE1C8D731C007985D4 /* TensorSwiftTests-iOS */ = { + "______Target_TensorSwiftTests" /* TensorSwiftTests */ = { isa = PBXNativeTarget; - buildConfigurationList = D69C33FC1C8D731C007985D4 /* Build configuration list for PBXNativeTarget "TensorSwiftTests-iOS" */; + buildConfigurationList = "_______Confs_TensorSwiftTests" /* Build configuration list for PBXNativeTarget "TensorSwiftTests" */; buildPhases = ( - D69C33EB1C8D731C007985D4 /* Sources */, - D69C33EC1C8D731C007985D4 /* Frameworks */, - D69C33ED1C8D731C007985D4 /* Resources */, + CompilePhase_TensorSwiftTests /* Sources */, + "___LinkPhase_TensorSwiftTests" /* Frameworks */, ); buildRules = ( ); dependencies = ( - D69C33F21C8D731C007985D4 /* PBXTargetDependency */, + __Dependency_TensorSwift /* PBXTargetDependency */, ); - name = "TensorSwiftTests-iOS"; + name = TensorSwiftTests; productName = TensorSwiftTests; - productReference = D69C33EF1C8D731C007985D4 /* TensorSwiftTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; - D6CE6C821CEED6F7004EAAE9 /* TensorSwift-OSX */ = { - isa = PBXNativeTarget; - buildConfigurationList = D6CE6C981CEED6F8004EAAE9 /* Build configuration list for PBXNativeTarget "TensorSwift-OSX" */; - buildPhases = ( - D6CE6C7E1CEED6F7004EAAE9 /* Sources */, - D6CE6C7F1CEED6F7004EAAE9 /* Frameworks */, - D6CE6C801CEED6F7004EAAE9 /* Headers */, - D6CE6C811CEED6F7004EAAE9 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = "TensorSwift-OSX"; - productName = "TensorSwift-OSX"; - productReference = D6CE6C831CEED6F7004EAAE9 /* TensorSwift.framework */; - productType = "com.apple.product-type.framework"; - }; - D6CE6C8B1CEED6F8004EAAE9 /* TensorSwiftTests-OSX */ = { - isa = PBXNativeTarget; - buildConfigurationList = D6CE6C991CEED6F8004EAAE9 /* Build configuration list for PBXNativeTarget "TensorSwiftTests-OSX" */; - buildPhases = ( - D6CE6C881CEED6F8004EAAE9 /* Sources */, - D6CE6C891CEED6F8004EAAE9 /* Frameworks */, - D6CE6C8A1CEED6F8004EAAE9 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - D6CE6C8F1CEED6F8004EAAE9 /* PBXTargetDependency */, - ); - name = "TensorSwiftTests-OSX"; - productName = "TensorSwift-OSXTests"; - productReference = D6CE6C8C1CEED6F8004EAAE9 /* TensorSwiftTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; - D6CE6C9E1CEED72F004EAAE9 /* TensorSwift-tvOS */ = { - isa = PBXNativeTarget; - buildConfigurationList = D6CE6CB01CEED72F004EAAE9 /* Build configuration list for PBXNativeTarget "TensorSwift-tvOS" */; - buildPhases = ( - D6CE6C9A1CEED72F004EAAE9 /* Sources */, - D6CE6C9B1CEED72F004EAAE9 /* Frameworks */, - D6CE6C9C1CEED72F004EAAE9 /* Headers */, - D6CE6C9D1CEED72F004EAAE9 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = "TensorSwift-tvOS"; - productName = "TensorSwift-tvOS"; - productReference = D6CE6C9F1CEED72F004EAAE9 /* TensorSwift.framework */; - productType = "com.apple.product-type.framework"; - }; - D6CE6CA71CEED72F004EAAE9 /* TensorSwiftTests-tvOS */ = { - isa = PBXNativeTarget; - buildConfigurationList = D6CE6CB31CEED72F004EAAE9 /* Build configuration list for PBXNativeTarget "TensorSwiftTests-tvOS" */; - buildPhases = ( - D6CE6CA41CEED72F004EAAE9 /* Sources */, - D6CE6CA51CEED72F004EAAE9 /* Frameworks */, - D6CE6CA61CEED72F004EAAE9 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - D6CE6CAB1CEED72F004EAAE9 /* PBXTargetDependency */, - ); - name = "TensorSwiftTests-tvOS"; - productName = "TensorSwift-tvOSTests"; - productReference = D6CE6CA81CEED72F004EAAE9 /* TensorSwiftTests.xctest */; + productReference = "_____Product_TensorSwiftTests" /* TensorSwiftTests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; - D6CE6CBA1CEED740004EAAE9 /* TensorSwift-watchOS */ = { - isa = PBXNativeTarget; - buildConfigurationList = D6CE6CC01CEED740004EAAE9 /* Build configuration list for PBXNativeTarget "TensorSwift-watchOS" */; - buildPhases = ( - D6CE6CB61CEED740004EAAE9 /* Sources */, - D6CE6CB71CEED740004EAAE9 /* Frameworks */, - D6CE6CB81CEED740004EAAE9 /* Headers */, - D6CE6CB91CEED740004EAAE9 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = "TensorSwift-watchOS"; - productName = "TensorSwift-watchOS"; - productReference = D6CE6CBB1CEED740004EAAE9 /* TensorSwift.framework */; - productType = "com.apple.product-type.framework"; - }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ - D69C33DC1C8D731C007985D4 /* Project object */ = { + __RootObject_ /* Project object */ = { isa = PBXProject; attributes = { - LastSwiftUpdateCheck = 0730; - LastUpgradeCheck = 0720; - ORGANIZATIONNAME = "Qoncept, Inc."; - TargetAttributes = { - D63F30001C996F4100B88E12 = { - CreatedOnToolsVersion = 7.2.1; - }; - D63F30131C996F4200B88E12 = { - CreatedOnToolsVersion = 7.2.1; - TestTargetID = D63F30001C996F4100B88E12; - }; - D69C33E41C8D731C007985D4 = { - CreatedOnToolsVersion = 7.2.1; - LastSwiftMigration = 0800; - }; - D69C33EE1C8D731C007985D4 = { - CreatedOnToolsVersion = 7.2.1; - LastSwiftMigration = 0800; - }; - D6CE6C821CEED6F7004EAAE9 = { - CreatedOnToolsVersion = 7.3; - }; - D6CE6C8B1CEED6F8004EAAE9 = { - CreatedOnToolsVersion = 7.3; - }; - D6CE6C9E1CEED72F004EAAE9 = { - CreatedOnToolsVersion = 7.3; - }; - D6CE6CA71CEED72F004EAAE9 = { - CreatedOnToolsVersion = 7.3; - }; - D6CE6CBA1CEED740004EAAE9 = { - CreatedOnToolsVersion = 7.3; - }; - }; + LastUpgradeCheck = 9999; }; - buildConfigurationList = D69C33DF1C8D731C007985D4 /* Build configuration list for PBXProject "TensorSwift" */; + buildConfigurationList = "___RootConfs_" /* Build configuration list for PBXProject "TensorSwift" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( en, - Base, ); - mainGroup = D69C33DB1C8D731C007985D4; - productRefGroup = D69C33E61C8D731C007985D4 /* Products */; + mainGroup = "___RootGroup_"; + productRefGroup = "____Products_" /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( - D69C33E41C8D731C007985D4 /* TensorSwift-iOS */, - D69C33EE1C8D731C007985D4 /* TensorSwiftTests-iOS */, - D6CE6C821CEED6F7004EAAE9 /* TensorSwift-OSX */, - D6CE6C8B1CEED6F8004EAAE9 /* TensorSwiftTests-OSX */, - D6CE6C9E1CEED72F004EAAE9 /* TensorSwift-tvOS */, - D6CE6CA71CEED72F004EAAE9 /* TensorSwiftTests-tvOS */, - D6CE6CBA1CEED740004EAAE9 /* TensorSwift-watchOS */, - D63F30001C996F4100B88E12 /* MNIST */, - D63F30131C996F4200B88E12 /* MNISTTests */, + "______Target_TensorSwift" /* TensorSwift */, + "______Target_TensorSwiftTests" /* TensorSwiftTests */, ); }; /* End PBXProject section */ -/* Begin PBXResourcesBuildPhase section */ - D63F2FFF1C996F4100B88E12 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - D6312E5D1CE4397500985B92 /* W_fc2 in Resources */, - D6312E531CE4397500985B92 /* b_fc1 in Resources */, - D6312E5B1CE4397500985B92 /* W_fc1 in Resources */, - D6312E551CE4397500985B92 /* b_fc2 in Resources */, - D6312E511CE4397500985B92 /* b_conv2 in Resources */, - D6312E591CE4397500985B92 /* W_conv2 in Resources */, - D63F300E1C996F4200B88E12 /* LaunchScreen.storyboard in Resources */, - D6312E571CE4397500985B92 /* W_conv1 in Resources */, - D63F300B1C996F4200B88E12 /* Assets.xcassets in Resources */, - D63F30091C996F4200B88E12 /* Main.storyboard in Resources */, - D6312E4F1CE4397500985B92 /* b_conv1 in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - D63F30121C996F4200B88E12 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - D6312E581CE4397500985B92 /* W_conv1 in Resources */, - D6312E541CE4397500985B92 /* b_fc1 in Resources */, - D6312E561CE4397500985B92 /* b_fc2 in Resources */, - D6312E5A1CE4397500985B92 /* W_conv2 in Resources */, - D6312E521CE4397500985B92 /* b_conv2 in Resources */, - D6312E5C1CE4397500985B92 /* W_fc1 in Resources */, - D6312E5E1CE4397500985B92 /* W_fc2 in Resources */, - D6312E501CE4397500985B92 /* b_conv1 in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - D69C33E31C8D731C007985D4 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - D69C33ED1C8D731C007985D4 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - D6CE6C811CEED6F7004EAAE9 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - D6CE6C8A1CEED6F8004EAAE9 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - D6CE6C9D1CEED72F004EAAE9 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - D6CE6CA61CEED72F004EAAE9 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - D6CE6CB91CEED740004EAAE9 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - /* Begin PBXSourcesBuildPhase section */ - D63F2FFD1C996F4100B88E12 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - D63F30061C996F4100B88E12 /* ViewController.swift in Sources */, - D6312E6E1CE486A700985B92 /* CanvasView.swift in Sources */, - D6312E411CE33BB700985B92 /* Classifier.swift in Sources */, - D6312E451CE4351100985B92 /* String.swift in Sources */, - D63F30041C996F4100B88E12 /* AppDelegate.swift in Sources */, - D6312E6A1CE484FE00985B92 /* Line.swift in Sources */, - D6312E6C1CE4852800985B92 /* Canvas.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - D63F30101C996F4200B88E12 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - D6D5D4BA1CA24E7C0041BE85 /* Downloader.swift in Sources */, - 273614FA1CB3E72200CF4935 /* SHA1.swift in Sources */, - D6312E431CE4341500985B92 /* ClassifierTest.swift in Sources */, - D6312E631CE4699D00985B92 /* Array.swift in Sources */, - D6F63B0D1CB7593000F3C82E /* DownloaderTest.swift in Sources */, - D63F30191C996F4200B88E12 /* MNISTTest.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - D69C33E01C8D731C007985D4 /* Sources */ = { + CompilePhase_TensorSwift /* Sources */ = { isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; + buildActionMask = 0; files = ( - D69C34001C8D735C007985D4 /* Tensor.swift in Sources */, - D69C34081C8E7D03007985D4 /* Operators.swift in Sources */, - D69C340C1C8E85D0007985D4 /* TensorNN.swift in Sources */, - D66E2A931CCDD3C700859630 /* Utils.swift in Sources */, - D69C34021C8D7435007985D4 /* Shape.swift in Sources */, - D69C34041C8D7487007985D4 /* Dimension.swift in Sources */, - D69C340A1C8E7D44007985D4 /* TensorMath.swift in Sources */, + __src_cc_ref_Sources/Dimension.swift /* Dimension.swift in Sources */, + __src_cc_ref_Sources/Operators.swift /* Operators.swift in Sources */, + __src_cc_ref_Sources/Shape.swift /* Shape.swift in Sources */, + __src_cc_ref_Sources/Tensor.swift /* Tensor.swift in Sources */, + __src_cc_ref_Sources/TensorMath.swift /* TensorMath.swift in Sources */, + __src_cc_ref_Sources/TensorNN.swift /* TensorNN.swift in Sources */, + __src_cc_ref_Sources/Utils.swift /* Utils.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; - D69C33EB1C8D731C007985D4 /* Sources */ = { + CompilePhase_TensorSwiftTests /* Sources */ = { isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; + buildActionMask = 0; files = ( - D69C34111C8ED4FD007985D4 /* TensorNNTest.swift in Sources */, - D6312E701CE5D7BB00985B92 /* DimensionTest.swift in Sources */, - A7E021DB1CAA4B2F00BAFC54 /* CalculationPerformanceTests.swift in Sources */, - A7DF6CC61D9924C30097CEB7 /* PowerTest.swift in Sources */, - D69C34061C8D8F87007985D4 /* TensorSwiftSample.swift in Sources */, - D69C33F51C8D731C007985D4 /* TensorTest.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - D6CE6C7E1CEED6F7004EAAE9 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - D6CE6CC51CEED89B004EAAE9 /* TensorMath.swift in Sources */, - D6CE6CC41CEED89B004EAAE9 /* Tensor.swift in Sources */, - D6CE6CC61CEED89B004EAAE9 /* TensorNN.swift in Sources */, - D6CE6CCA1CEED89B004EAAE9 /* Utils.swift in Sources */, - D6CE6CC81CEED89B004EAAE9 /* Dimension.swift in Sources */, - D6CE6CC71CEED89B004EAAE9 /* Shape.swift in Sources */, - D6CE6CC91CEED89B004EAAE9 /* Operators.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - D6CE6C881CEED6F8004EAAE9 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - D6CE6CDE1CEED8AD004EAAE9 /* CalculationPerformanceTests.swift in Sources */, - D6CE6CDC1CEED8AD004EAAE9 /* TensorNNTest.swift in Sources */, - D6CE6CDB1CEED8AD004EAAE9 /* TensorTest.swift in Sources */, - D6CE6CDD1CEED8AD004EAAE9 /* DimensionTest.swift in Sources */, - D6CE6CDF1CEED8AD004EAAE9 /* TensorSwiftSample.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - D6CE6C9A1CEED72F004EAAE9 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - D6CE6CCD1CEED89C004EAAE9 /* TensorMath.swift in Sources */, - D6CE6CCC1CEED89C004EAAE9 /* Tensor.swift in Sources */, - D6CE6CCE1CEED89C004EAAE9 /* TensorNN.swift in Sources */, - D6CE6CD21CEED89C004EAAE9 /* Utils.swift in Sources */, - D6CE6CD01CEED89C004EAAE9 /* Dimension.swift in Sources */, - D6CE6CCF1CEED89C004EAAE9 /* Shape.swift in Sources */, - D6CE6CD11CEED89C004EAAE9 /* Operators.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - D6CE6CA41CEED72F004EAAE9 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - D6CE6CE31CEED8AF004EAAE9 /* CalculationPerformanceTests.swift in Sources */, - D6CE6CE11CEED8AF004EAAE9 /* TensorNNTest.swift in Sources */, - D6CE6CE01CEED8AF004EAAE9 /* TensorTest.swift in Sources */, - D6CE6CE21CEED8AF004EAAE9 /* DimensionTest.swift in Sources */, - D6CE6CE41CEED8AF004EAAE9 /* TensorSwiftSample.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - D6CE6CB61CEED740004EAAE9 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - D6CE6CD51CEED89D004EAAE9 /* TensorMath.swift in Sources */, - D6CE6CD41CEED89D004EAAE9 /* Tensor.swift in Sources */, - D6CE6CD61CEED89D004EAAE9 /* TensorNN.swift in Sources */, - D6CE6CDA1CEED89D004EAAE9 /* Utils.swift in Sources */, - D6CE6CD81CEED89D004EAAE9 /* Dimension.swift in Sources */, - D6CE6CD71CEED89D004EAAE9 /* Shape.swift in Sources */, - D6CE6CD91CEED89D004EAAE9 /* Operators.swift in Sources */, + __src_cc_ref_Tests/TensorSwiftTests/CalculationPerformanceTests.swift /* CalculationPerformanceTests.swift in Sources */, + __src_cc_ref_Tests/TensorSwiftTests/DimensionTest.swift /* DimensionTest.swift in Sources */, + __src_cc_ref_Tests/TensorSwiftTests/PowerTest.swift /* PowerTest.swift in Sources */, + __src_cc_ref_Tests/TensorSwiftTests/TensorNNTest.swift /* TensorNNTest.swift in Sources */, + __src_cc_ref_Tests/TensorSwiftTests/TensorSwiftSample.swift /* TensorSwiftSample.swift in Sources */, + __src_cc_ref_Tests/TensorSwiftTests/TensorTest.swift /* TensorTest.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ - D6312E671CE46BDE00985B92 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = D69C33E41C8D731C007985D4 /* TensorSwift-iOS */; - targetProxy = D6312E661CE46BDE00985B92 /* PBXContainerItemProxy */; - }; - D63F30161C996F4200B88E12 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = D63F30001C996F4100B88E12 /* MNIST */; - targetProxy = D63F30151C996F4200B88E12 /* PBXContainerItemProxy */; - }; - D69C33F21C8D731C007985D4 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = D69C33E41C8D731C007985D4 /* TensorSwift-iOS */; - targetProxy = D69C33F11C8D731C007985D4 /* PBXContainerItemProxy */; - }; - D6CE6C8F1CEED6F8004EAAE9 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = D6CE6C821CEED6F7004EAAE9 /* TensorSwift-OSX */; - targetProxy = D6CE6C8E1CEED6F8004EAAE9 /* PBXContainerItemProxy */; - }; - D6CE6CAB1CEED72F004EAAE9 /* PBXTargetDependency */ = { + __Dependency_TensorSwift /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = D6CE6C9E1CEED72F004EAAE9 /* TensorSwift-tvOS */; - targetProxy = D6CE6CAA1CEED72F004EAAE9 /* PBXContainerItemProxy */; + target = "______Target_TensorSwift" /* TensorSwift */; + targetProxy = A7DF6EB61D9A1AC40097CEB7 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ -/* Begin PBXVariantGroup section */ - D63F30071C996F4200B88E12 /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - D63F30081C996F4200B88E12 /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - D63F300C1C996F4200B88E12 /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - D63F300D1C996F4200B88E12 /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - /* Begin XCBuildConfiguration section */ - D63F301B1C996F4200B88E12 /* Debug */ = { + _ReleaseConf_TensorSwift /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - EMBEDDED_CONTENT_CONTAINS_SWIFT = YES; - INFOPLIST_FILE = MNIST/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = jp.co.qoncept.MNIST; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Debug; - }; - D63F301C1C996F4200B88E12 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - EMBEDDED_CONTENT_CONTAINS_SWIFT = YES; - INFOPLIST_FILE = MNIST/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = jp.co.qoncept.MNIST; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Release; - }; - D63F301D1C996F4200B88E12 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - INFOPLIST_FILE = MNISTTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = jp.co.qoncept.MNISTTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_INCLUDE_PATHS = ./zlib; - SWIFT_OBJC_BRIDGING_HEADER = "MNISTTests/MNISTTests-Bridging-Header.h"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/MNIST.app/MNIST"; - }; - name = Debug; - }; - D63F301E1C996F4200B88E12 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - INFOPLIST_FILE = MNISTTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = jp.co.qoncept.MNISTTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_INCLUDE_PATHS = ./zlib; - SWIFT_OBJC_BRIDGING_HEADER = "MNISTTests/MNISTTests-Bridging-Header.h"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/MNIST.app/MNIST"; - }; - name = Release; - }; - D69C33F71C8D731C007985D4 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MACOSX_DEPLOYMENT_TARGET = 10.9; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Debug; - }; - D69C33F81C8D731C007985D4 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; + FRAMEWORK_SEARCH_PATHS = "$(PLATFORM_DIR)/Developer/Library/Frameworks"; + INFOPLIST_FILE = TensorSwift.xcodeproj/TensorSwift_Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MACOSX_DEPLOYMENT_TARGET = 10.9; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; - D69C33FA1C8D731C007985D4 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - DEFINES_MODULE = YES; - DEVELOPMENT_TEAM = ""; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = TensorSwift/Info.plist; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - ONLY_ACTIVE_ARCH = YES; - PRODUCT_BUNDLE_IDENTIFIER = jp.co.qoncept.TensorSwift; - PRODUCT_NAME = TensorSwift; - SKIP_INSTALL = YES; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + LD_RUNPATH_SEARCH_PATHS = "$(TOOLCHAIN_DIR)/usr/lib/swift/macosx"; + OTHER_LDFLAGS = "$(inherited)"; + OTHER_SWIFT_FLAGS = "$(inherited)"; + PRODUCT_BUNDLE_IDENTIFIER = TensorSwift; + PRODUCT_MODULE_NAME = "$(TARGET_NAME:c99extidentifier)"; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SWIFT_VERSION = 3.0; }; - name = Debug; + name = Release; }; - D69C33FB1C8D731C007985D4 /* Release */ = { + _ReleaseConf_TensorSwiftTests /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - CLANG_ENABLE_MODULES = YES; - DEFINES_MODULE = YES; - DEVELOPMENT_TEAM = ""; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = TensorSwift/Info.plist; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = jp.co.qoncept.TensorSwift; - PRODUCT_NAME = TensorSwift; - SKIP_INSTALL = YES; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + EMBEDDED_CONTENT_CONTAINS_SWIFT = YES; + FRAMEWORK_SEARCH_PATHS = "$(PLATFORM_DIR)/Developer/Library/Frameworks"; + INFOPLIST_FILE = TensorSwift.xcodeproj/TensorSwiftTests_Info.plist; + LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks"; + OTHER_LDFLAGS = "$(inherited)"; + OTHER_SWIFT_FLAGS = "$(inherited)"; SWIFT_VERSION = 3.0; }; name = Release; }; - D69C33FD1C8D731C007985D4 /* Debug */ = { + "___DebugConf_TensorSwift" /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = TensorSwiftTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = jp.co.qoncept.TensorSwiftTests; - PRODUCT_NAME = TensorSwiftTests; + ENABLE_TESTABILITY = YES; + FRAMEWORK_SEARCH_PATHS = "$(PLATFORM_DIR)/Developer/Library/Frameworks"; + INFOPLIST_FILE = TensorSwift.xcodeproj/TensorSwift_Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(TOOLCHAIN_DIR)/usr/lib/swift/macosx"; + OTHER_LDFLAGS = "$(inherited)"; + OTHER_SWIFT_FLAGS = "$(inherited)"; + PRODUCT_BUNDLE_IDENTIFIER = TensorSwift; + PRODUCT_MODULE_NAME = "$(TARGET_NAME:c99extidentifier)"; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 3.0; }; name = Debug; }; - D69C33FE1C8D731C007985D4 /* Release */ = { + "___DebugConf_TensorSwiftTests" /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = TensorSwiftTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = jp.co.qoncept.TensorSwiftTests; - PRODUCT_NAME = TensorSwiftTests; + EMBEDDED_CONTENT_CONTAINS_SWIFT = YES; + FRAMEWORK_SEARCH_PATHS = "$(PLATFORM_DIR)/Developer/Library/Frameworks"; + INFOPLIST_FILE = TensorSwift.xcodeproj/TensorSwiftTests_Info.plist; + LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks"; + OTHER_LDFLAGS = "$(inherited)"; + OTHER_SWIFT_FLAGS = "$(inherited)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 3.0; }; - name = Release; - }; - D6CE6C941CEED6F8004EAAE9 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_ANALYZER_NONNULL = YES; - COMBINE_HIDPI_IMAGES = YES; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - FRAMEWORK_VERSION = A; - INFOPLIST_FILE = TensorSwift/Info.plist; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.11; - PRODUCT_BUNDLE_IDENTIFIER = jp.co.qoncept.TensorSwift; - PRODUCT_NAME = TensorSwift; - SDKROOT = macosx; - SKIP_INSTALL = YES; - }; - name = Debug; - }; - D6CE6C951CEED6F8004EAAE9 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_ANALYZER_NONNULL = YES; - COMBINE_HIDPI_IMAGES = YES; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - FRAMEWORK_VERSION = A; - INFOPLIST_FILE = TensorSwift/Info.plist; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.11; - PRODUCT_BUNDLE_IDENTIFIER = jp.co.qoncept.TensorSwift; - PRODUCT_NAME = TensorSwift; - SDKROOT = macosx; - SKIP_INSTALL = YES; - }; - name = Release; - }; - D6CE6C961CEED6F8004EAAE9 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_ANALYZER_NONNULL = YES; - CODE_SIGN_IDENTITY = "-"; - COMBINE_HIDPI_IMAGES = YES; - INFOPLIST_FILE = TensorSwiftTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.11; - PRODUCT_BUNDLE_IDENTIFIER = jp.co.qoncept.TensorSwiftTests; - PRODUCT_NAME = TensorSwiftTests; - SDKROOT = macosx; - }; - name = Debug; - }; - D6CE6C971CEED6F8004EAAE9 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_ANALYZER_NONNULL = YES; - CODE_SIGN_IDENTITY = "-"; - COMBINE_HIDPI_IMAGES = YES; - INFOPLIST_FILE = TensorSwiftTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.11; - PRODUCT_BUNDLE_IDENTIFIER = jp.co.qoncept.TensorSwiftTests; - PRODUCT_NAME = TensorSwiftTests; - SDKROOT = macosx; - }; - name = Release; - }; - D6CE6CB11CEED72F004EAAE9 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_ANALYZER_NONNULL = YES; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = TensorSwift/Info.plist; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = jp.co.qoncept.TensorSwift; - PRODUCT_NAME = TensorSwift; - SDKROOT = appletvos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 9.2; - }; - name = Debug; - }; - D6CE6CB21CEED72F004EAAE9 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_ANALYZER_NONNULL = YES; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = TensorSwift/Info.plist; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = jp.co.qoncept.TensorSwift; - PRODUCT_NAME = TensorSwift; - SDKROOT = appletvos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 9.2; - }; - name = Release; - }; - D6CE6CB41CEED72F004EAAE9 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_ANALYZER_NONNULL = YES; - INFOPLIST_FILE = TensorSwiftTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = jp.co.qoncept.TensorSwiftTests; - PRODUCT_NAME = TensorSwiftTests; - SDKROOT = appletvos; - TVOS_DEPLOYMENT_TARGET = 9.2; - }; name = Debug; }; - D6CE6CB51CEED72F004EAAE9 /* Release */ = { + "_____Release_" /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = __PBXFileRef_TensorSwift.xcodeproj/Configs/Project.xcconfig /* TensorSwift.xcodeproj/Configs/Project.xcconfig */; buildSettings = { - CLANG_ANALYZER_NONNULL = YES; - INFOPLIST_FILE = TensorSwiftTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = jp.co.qoncept.TensorSwiftTests; - PRODUCT_NAME = TensorSwiftTests; - SDKROOT = appletvos; - TVOS_DEPLOYMENT_TARGET = 9.2; }; name = Release; }; - D6CE6CC11CEED740004EAAE9 /* Debug */ = { + "_______Debug_" /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = __PBXFileRef_TensorSwift.xcodeproj/Configs/Project.xcconfig /* TensorSwift.xcodeproj/Configs/Project.xcconfig */; buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; - CLANG_ANALYZER_NONNULL = YES; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = TensorSwift/Info.plist; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = jp.co.qoncept.TensorSwift; - PRODUCT_NAME = TensorSwift; - SDKROOT = watchos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = 4; - WATCHOS_DEPLOYMENT_TARGET = 2.2; }; name = Debug; }; - D6CE6CC21CEED740004EAAE9 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; - CLANG_ANALYZER_NONNULL = YES; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = TensorSwift/Info.plist; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = jp.co.qoncept.TensorSwift; - PRODUCT_NAME = TensorSwift; - SDKROOT = watchos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = 4; - WATCHOS_DEPLOYMENT_TARGET = 2.2; - }; - name = Release; - }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - D63F301F1C996F4200B88E12 /* Build configuration list for PBXNativeTarget "MNIST" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - D63F301B1C996F4200B88E12 /* Debug */, - D63F301C1C996F4200B88E12 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - D63F30201C996F4200B88E12 /* Build configuration list for PBXNativeTarget "MNISTTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - D63F301D1C996F4200B88E12 /* Debug */, - D63F301E1C996F4200B88E12 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - D69C33DF1C8D731C007985D4 /* Build configuration list for PBXProject "TensorSwift" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - D69C33F71C8D731C007985D4 /* Debug */, - D69C33F81C8D731C007985D4 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - D69C33F91C8D731C007985D4 /* Build configuration list for PBXNativeTarget "TensorSwift-iOS" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - D69C33FA1C8D731C007985D4 /* Debug */, - D69C33FB1C8D731C007985D4 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - D69C33FC1C8D731C007985D4 /* Build configuration list for PBXNativeTarget "TensorSwiftTests-iOS" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - D69C33FD1C8D731C007985D4 /* Debug */, - D69C33FE1C8D731C007985D4 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - D6CE6C981CEED6F8004EAAE9 /* Build configuration list for PBXNativeTarget "TensorSwift-OSX" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - D6CE6C941CEED6F8004EAAE9 /* Debug */, - D6CE6C951CEED6F8004EAAE9 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - D6CE6C991CEED6F8004EAAE9 /* Build configuration list for PBXNativeTarget "TensorSwiftTests-OSX" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - D6CE6C961CEED6F8004EAAE9 /* Debug */, - D6CE6C971CEED6F8004EAAE9 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - D6CE6CB01CEED72F004EAAE9 /* Build configuration list for PBXNativeTarget "TensorSwift-tvOS" */ = { + "___RootConfs_" /* Build configuration list for PBXProject "TensorSwift" */ = { isa = XCConfigurationList; buildConfigurations = ( - D6CE6CB11CEED72F004EAAE9 /* Debug */, - D6CE6CB21CEED72F004EAAE9 /* Release */, + "_______Debug_" /* Debug */, + "_____Release_" /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; + defaultConfigurationName = Debug; }; - D6CE6CB31CEED72F004EAAE9 /* Build configuration list for PBXNativeTarget "TensorSwiftTests-tvOS" */ = { + "_______Confs_TensorSwift" /* Build configuration list for PBXNativeTarget "TensorSwift" */ = { isa = XCConfigurationList; buildConfigurations = ( - D6CE6CB41CEED72F004EAAE9 /* Debug */, - D6CE6CB51CEED72F004EAAE9 /* Release */, + "___DebugConf_TensorSwift" /* Debug */, + _ReleaseConf_TensorSwift /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; + defaultConfigurationName = Debug; }; - D6CE6CC01CEED740004EAAE9 /* Build configuration list for PBXNativeTarget "TensorSwift-watchOS" */ = { + "_______Confs_TensorSwiftTests" /* Build configuration list for PBXNativeTarget "TensorSwiftTests" */ = { isa = XCConfigurationList; buildConfigurations = ( - D6CE6CC11CEED740004EAAE9 /* Debug */, - D6CE6CC21CEED740004EAAE9 /* Release */, + "___DebugConf_TensorSwiftTests" /* Debug */, + _ReleaseConf_TensorSwiftTests /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; + defaultConfigurationName = Debug; }; /* End XCConfigurationList section */ }; - rootObject = D69C33DC1C8D731C007985D4 /* Project object */; + rootObject = __RootObject_ /* Project object */; } diff --git a/TensorSwift.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/TensorSwift.xcodeproj/project.xcworkspace/contents.xcworkspacedata index aa32b76..919434a 100644 --- a/TensorSwift.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ b/TensorSwift.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -2,6 +2,6 @@ + location = "self:"> diff --git a/TensorSwift.xcodeproj/project.xcworkspace/xcshareddata/TensorSwift.xcscmblueprint b/TensorSwift.xcodeproj/project.xcworkspace/xcshareddata/TensorSwift.xcscmblueprint deleted file mode 100644 index ccf289f..0000000 --- a/TensorSwift.xcodeproj/project.xcworkspace/xcshareddata/TensorSwift.xcscmblueprint +++ /dev/null @@ -1,30 +0,0 @@ -{ - "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "CCDC2BEAB93820BE1DDD6D36F8B9D2CF4E8BD09E", - "DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : { - - }, - "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : { - "CCDC2BEAB93820BE1DDD6D36F8B9D2CF4E8BD09E" : 0, - "18D6DCF80925D0A5F4A2E9949DF09AF85B0E1068" : 0 - }, - "DVTSourceControlWorkspaceBlueprintIdentifierKey" : "0556DE8C-97B0-412A-B88B-E9D3D6B8C28F", - "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : { - "CCDC2BEAB93820BE1DDD6D36F8B9D2CF4E8BD09E" : "TensorSwift\/", - "18D6DCF80925D0A5F4A2E9949DF09AF85B0E1068" : ".." - }, - "DVTSourceControlWorkspaceBlueprintNameKey" : "TensorSwift", - "DVTSourceControlWorkspaceBlueprintVersion" : 204, - "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "TensorSwift.xcodeproj", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [ - { - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "ghe.qar.jp:qoncept\/osaka-station-navi-demo.git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "18D6DCF80925D0A5F4A2E9949DF09AF85B0E1068" - }, - { - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "github.com:qoncept\/TensorSwift.git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "CCDC2BEAB93820BE1DDD6D36F8B9D2CF4E8BD09E" - } - ] -} \ No newline at end of file diff --git a/TensorSwift.xcodeproj/xcshareddata/xcschemes/TensorSwift-OSX.xcscheme b/TensorSwift.xcodeproj/xcshareddata/xcschemes/TensorSwift-OSX.xcscheme deleted file mode 100644 index a8c1533..0000000 --- a/TensorSwift.xcodeproj/xcshareddata/xcschemes/TensorSwift-OSX.xcscheme +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/TensorSwift.xcodeproj/xcshareddata/xcschemes/TensorSwift-iOS.xcscheme b/TensorSwift.xcodeproj/xcshareddata/xcschemes/TensorSwift-iOS.xcscheme deleted file mode 100644 index c2a4340..0000000 --- a/TensorSwift.xcodeproj/xcshareddata/xcschemes/TensorSwift-iOS.xcscheme +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Tests/LinuxMain.swift b/Tests/LinuxMain.swift new file mode 100644 index 0000000..98c9f8f --- /dev/null +++ b/Tests/LinuxMain.swift @@ -0,0 +1,6 @@ +import XCTest +@testable import TensorSwiftTests + +XCTMain([ + testCase(TensorSwiftTests.allTests), +]) diff --git a/TensorSwiftTests/CalculationPerformanceTests.swift b/Tests/TensorSwiftTests/CalculationPerformanceTests.swift similarity index 100% rename from TensorSwiftTests/CalculationPerformanceTests.swift rename to Tests/TensorSwiftTests/CalculationPerformanceTests.swift diff --git a/TensorSwiftTests/DimensionTest.swift b/Tests/TensorSwiftTests/DimensionTest.swift similarity index 100% rename from TensorSwiftTests/DimensionTest.swift rename to Tests/TensorSwiftTests/DimensionTest.swift diff --git a/TensorSwiftTests/Info.plist b/Tests/TensorSwiftTests/Info.plist similarity index 100% rename from TensorSwiftTests/Info.plist rename to Tests/TensorSwiftTests/Info.plist diff --git a/TensorSwiftTests/PowerTest.swift b/Tests/TensorSwiftTests/PowerTest.swift similarity index 100% rename from TensorSwiftTests/PowerTest.swift rename to Tests/TensorSwiftTests/PowerTest.swift diff --git a/TensorSwiftTests/TensorNNTest.swift b/Tests/TensorSwiftTests/TensorNNTest.swift similarity index 100% rename from TensorSwiftTests/TensorNNTest.swift rename to Tests/TensorSwiftTests/TensorNNTest.swift diff --git a/TensorSwiftTests/TensorSwiftSample.swift b/Tests/TensorSwiftTests/TensorSwiftSample.swift similarity index 100% rename from TensorSwiftTests/TensorSwiftSample.swift rename to Tests/TensorSwiftTests/TensorSwiftSample.swift diff --git a/TensorSwiftTests/TensorTest.swift b/Tests/TensorSwiftTests/TensorTest.swift similarity index 100% rename from TensorSwiftTests/TensorTest.swift rename to Tests/TensorSwiftTests/TensorTest.swift From 81189c0cf9348f21732383e8848b07b7bb376102 Mon Sep 17 00:00:00 2001 From: araki Date: Tue, 27 Sep 2016 12:21:35 +0900 Subject: [PATCH 03/26] Move MNIST. --- MNIST/CanvasView.swift | 52 -- MNIST/MNIST.xcodeproj/project.pbxproj | 707 ++++++++++++++++++ .../contents.xcworkspacedata | 7 + MNIST/{ => MNIST}/AppDelegate.swift | 12 +- .../AppIcon.appiconset/Contents.json | 0 .../Base.lproj/LaunchScreen.storyboard | 0 MNIST/{ => MNIST}/Base.lproj/Main.storyboard | 0 MNIST/{ => MNIST}/Canvas.swift | 4 +- MNIST/MNIST/CanvasView.swift | 52 ++ MNIST/{ => MNIST}/Classifier.swift | 10 +- MNIST/{ => MNIST}/Info.plist | 0 MNIST/{ => MNIST}/Line.swift | 0 MNIST/{ => MNIST}/Models/W_conv1 | Bin MNIST/{ => MNIST}/Models/W_conv2 | Bin MNIST/{ => MNIST}/Models/W_fc1 | Bin MNIST/{ => MNIST}/Models/W_fc2 | Bin MNIST/{ => MNIST}/Models/b_conv1 | 0 MNIST/{ => MNIST}/Models/b_conv2 | 0 MNIST/{ => MNIST}/Models/b_fc1 | Bin MNIST/{ => MNIST}/Models/b_fc2 | 0 MNIST/MNIST/String.swift | 7 + MNIST/MNIST/ViewController.swift | 35 + {MNISTTests => MNIST/MNISTTests}/Array.swift | 0 .../MNISTTests}/ClassifierTest.swift | 0 .../MNISTTests}/Downloader.swift | 0 .../MNISTTests}/DownloaderTest.swift | 0 {MNISTTests => MNIST/MNISTTests}/Header.h | 0 {MNISTTests => MNIST/MNISTTests}/Info.plist | 0 .../MNISTTests}/MNISTTest.swift | 0 .../MNISTTests}/MNISTTests-Bridging-Header.h | 0 {MNISTTests => MNIST/MNISTTests}/SHA1.swift | 0 MNIST/MNISTUITests/Info.plist | 22 + MNIST/MNISTUITests/MNISTUITests.swift | 36 + MNIST/String.swift | 7 - MNIST/ViewController.swift | 35 - 35 files changed, 879 insertions(+), 107 deletions(-) delete mode 100644 MNIST/CanvasView.swift create mode 100644 MNIST/MNIST.xcodeproj/project.pbxproj create mode 100644 MNIST/MNIST.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename MNIST/{ => MNIST}/AppDelegate.swift (76%) rename MNIST/{ => MNIST}/Assets.xcassets/AppIcon.appiconset/Contents.json (100%) rename MNIST/{ => MNIST}/Base.lproj/LaunchScreen.storyboard (100%) rename MNIST/{ => MNIST}/Base.lproj/Main.storyboard (100%) rename MNIST/{ => MNIST}/Canvas.swift (82%) create mode 100644 MNIST/MNIST/CanvasView.swift rename MNIST/{ => MNIST}/Classifier.swift (81%) rename MNIST/{ => MNIST}/Info.plist (100%) rename MNIST/{ => MNIST}/Line.swift (100%) rename MNIST/{ => MNIST}/Models/W_conv1 (100%) rename MNIST/{ => MNIST}/Models/W_conv2 (100%) rename MNIST/{ => MNIST}/Models/W_fc1 (100%) rename MNIST/{ => MNIST}/Models/W_fc2 (100%) rename MNIST/{ => MNIST}/Models/b_conv1 (100%) rename MNIST/{ => MNIST}/Models/b_conv2 (100%) rename MNIST/{ => MNIST}/Models/b_fc1 (100%) rename MNIST/{ => MNIST}/Models/b_fc2 (100%) create mode 100644 MNIST/MNIST/String.swift create mode 100644 MNIST/MNIST/ViewController.swift rename {MNISTTests => MNIST/MNISTTests}/Array.swift (100%) rename {MNISTTests => MNIST/MNISTTests}/ClassifierTest.swift (100%) rename {MNISTTests => MNIST/MNISTTests}/Downloader.swift (100%) rename {MNISTTests => MNIST/MNISTTests}/DownloaderTest.swift (100%) rename {MNISTTests => MNIST/MNISTTests}/Header.h (100%) rename {MNISTTests => MNIST/MNISTTests}/Info.plist (100%) rename {MNISTTests => MNIST/MNISTTests}/MNISTTest.swift (100%) rename {MNISTTests => MNIST/MNISTTests}/MNISTTests-Bridging-Header.h (100%) rename {MNISTTests => MNIST/MNISTTests}/SHA1.swift (100%) create mode 100644 MNIST/MNISTUITests/Info.plist create mode 100644 MNIST/MNISTUITests/MNISTUITests.swift delete mode 100644 MNIST/String.swift delete mode 100644 MNIST/ViewController.swift diff --git a/MNIST/CanvasView.swift b/MNIST/CanvasView.swift deleted file mode 100644 index 79d2a4b..0000000 --- a/MNIST/CanvasView.swift +++ /dev/null @@ -1,52 +0,0 @@ -import UIKit - -class CanvasView: UIView { - private(set) var canvas: Canvas - - required init?(coder: NSCoder) { - canvas = Canvas() - super.init(coder: coder) - - self.addGestureRecognizer(UIPanGestureRecognizer(target: self, action: #selector(CanvasView.onPanGesture(_:)))) - } - - var image: UIImage { - UIGraphicsBeginImageContext(bounds.size) - layer.renderInContext(UIGraphicsGetCurrentContext()!) - let result = UIGraphicsGetImageFromCurrentImageContext() - UIGraphicsEndImageContext() - return result - } - - override func drawRect(rect: CGRect) { - let context = UIGraphicsGetCurrentContext() - for line in canvas.lines { - CGContextSetLineWidth(context, 20.0) - CGContextSetStrokeColorWithColor(context, UIColor(colorLiteralRed: 0.0, green: 0.0, blue: 0.0, alpha: 1.0).CGColor) - CGContextSetLineCap(context, .Round) - CGContextSetLineJoin(context, .Round) - for (index, point) in line.points.enumerate() { - if index == 0 { - CGContextMoveToPoint(context, point.x, point.y) - } else { - CGContextAddLineToPoint(context, point.x, point.y) - } - } - } - CGContextStrokePath(context) - } - - func onPanGesture(gestureRecognizer: UIPanGestureRecognizer) { - canvas.draw(gestureRecognizer.locationInView(self)) - if gestureRecognizer.state == .Ended { - canvas.newLine() - } - - setNeedsDisplay() - } - - func clear() { - canvas = Canvas() - setNeedsDisplay() - } -} \ No newline at end of file diff --git a/MNIST/MNIST.xcodeproj/project.pbxproj b/MNIST/MNIST.xcodeproj/project.pbxproj new file mode 100644 index 0000000..891c1c8 --- /dev/null +++ b/MNIST/MNIST.xcodeproj/project.pbxproj @@ -0,0 +1,707 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + A7DF6EC41D9A1B4A0097CEB7 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7DF6EC31D9A1B4A0097CEB7 /* AppDelegate.swift */; }; + A7DF6EC61D9A1B4A0097CEB7 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7DF6EC51D9A1B4A0097CEB7 /* ViewController.swift */; }; + A7DF6EC91D9A1B4A0097CEB7 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A7DF6EC71D9A1B4A0097CEB7 /* Main.storyboard */; }; + A7DF6ECB1D9A1B4A0097CEB7 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A7DF6ECA1D9A1B4A0097CEB7 /* Assets.xcassets */; }; + A7DF6ECE1D9A1B4A0097CEB7 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A7DF6ECC1D9A1B4A0097CEB7 /* LaunchScreen.storyboard */; }; + A7DF6EE41D9A1B4A0097CEB7 /* MNISTUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7DF6EE31D9A1B4A0097CEB7 /* MNISTUITests.swift */; }; + A7DF6EFA1D9A1B7D0097CEB7 /* TensorSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A7DF6EF71D9A1B5B0097CEB7 /* TensorSwift.framework */; }; + A7DF6EFB1D9A1B7D0097CEB7 /* TensorSwift.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = A7DF6EF71D9A1B5B0097CEB7 /* TensorSwift.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + A7DF6F0D1D9A1BC90097CEB7 /* Canvas.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7DF6EFF1D9A1BC90097CEB7 /* Canvas.swift */; }; + A7DF6F0E1D9A1BC90097CEB7 /* CanvasView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7DF6F001D9A1BC90097CEB7 /* CanvasView.swift */; }; + A7DF6F0F1D9A1BC90097CEB7 /* Classifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7DF6F011D9A1BC90097CEB7 /* Classifier.swift */; }; + A7DF6F101D9A1BC90097CEB7 /* Line.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7DF6F021D9A1BC90097CEB7 /* Line.swift */; }; + A7DF6F111D9A1BC90097CEB7 /* b_conv1 in Resources */ = {isa = PBXBuildFile; fileRef = A7DF6F041D9A1BC90097CEB7 /* b_conv1 */; }; + A7DF6F121D9A1BC90097CEB7 /* b_conv2 in Resources */ = {isa = PBXBuildFile; fileRef = A7DF6F051D9A1BC90097CEB7 /* b_conv2 */; }; + A7DF6F131D9A1BC90097CEB7 /* b_fc1 in Resources */ = {isa = PBXBuildFile; fileRef = A7DF6F061D9A1BC90097CEB7 /* b_fc1 */; }; + A7DF6F141D9A1BC90097CEB7 /* b_fc2 in Resources */ = {isa = PBXBuildFile; fileRef = A7DF6F071D9A1BC90097CEB7 /* b_fc2 */; }; + A7DF6F151D9A1BC90097CEB7 /* W_conv1 in Resources */ = {isa = PBXBuildFile; fileRef = A7DF6F081D9A1BC90097CEB7 /* W_conv1 */; }; + A7DF6F161D9A1BC90097CEB7 /* W_conv2 in Resources */ = {isa = PBXBuildFile; fileRef = A7DF6F091D9A1BC90097CEB7 /* W_conv2 */; }; + A7DF6F171D9A1BC90097CEB7 /* W_fc1 in Resources */ = {isa = PBXBuildFile; fileRef = A7DF6F0A1D9A1BC90097CEB7 /* W_fc1 */; }; + A7DF6F181D9A1BC90097CEB7 /* W_fc2 in Resources */ = {isa = PBXBuildFile; fileRef = A7DF6F0B1D9A1BC90097CEB7 /* W_fc2 */; }; + A7DF6F191D9A1BC90097CEB7 /* String.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7DF6F0C1D9A1BC90097CEB7 /* String.swift */; }; + A7DF6F231D9A1BDA0097CEB7 /* Array.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7DF6F1B1D9A1BDA0097CEB7 /* Array.swift */; }; + A7DF6F241D9A1BDA0097CEB7 /* ClassifierTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7DF6F1C1D9A1BDA0097CEB7 /* ClassifierTest.swift */; }; + A7DF6F251D9A1BDA0097CEB7 /* Downloader.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7DF6F1D1D9A1BDA0097CEB7 /* Downloader.swift */; }; + A7DF6F261D9A1BDA0097CEB7 /* DownloaderTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7DF6F1E1D9A1BDA0097CEB7 /* DownloaderTest.swift */; }; + A7DF6F271D9A1BDA0097CEB7 /* MNISTTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7DF6F201D9A1BDA0097CEB7 /* MNISTTest.swift */; }; + A7DF6F281D9A1BDA0097CEB7 /* SHA1.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7DF6F221D9A1BDA0097CEB7 /* SHA1.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + A7DF6ED51D9A1B4A0097CEB7 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = A7DF6EB81D9A1B4A0097CEB7 /* Project object */; + proxyType = 1; + remoteGlobalIDString = A7DF6EBF1D9A1B4A0097CEB7; + remoteInfo = MNIST; + }; + A7DF6EE01D9A1B4A0097CEB7 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = A7DF6EB81D9A1B4A0097CEB7 /* Project object */; + proxyType = 1; + remoteGlobalIDString = A7DF6EBF1D9A1B4A0097CEB7; + remoteInfo = MNIST; + }; + A7DF6EF61D9A1B5B0097CEB7 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = A7DF6EF11D9A1B5B0097CEB7 /* TensorSwift.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = "_____Product_TensorSwift"; + remoteInfo = TensorSwift; + }; + A7DF6EF81D9A1B5B0097CEB7 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = A7DF6EF11D9A1B5B0097CEB7 /* TensorSwift.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = "_____Product_TensorSwiftTests"; + remoteInfo = TensorSwiftTests; + }; + A7DF6EFC1D9A1B7D0097CEB7 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = A7DF6EF11D9A1B5B0097CEB7 /* TensorSwift.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = "______Target_TensorSwift"; + remoteInfo = TensorSwift; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + A7DF6EFE1D9A1B7D0097CEB7 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + A7DF6EFB1D9A1B7D0097CEB7 /* TensorSwift.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + A7DF6EC01D9A1B4A0097CEB7 /* MNIST.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MNIST.app; sourceTree = BUILT_PRODUCTS_DIR; }; + A7DF6EC31D9A1B4A0097CEB7 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + A7DF6EC51D9A1B4A0097CEB7 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + A7DF6EC81D9A1B4A0097CEB7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + A7DF6ECA1D9A1B4A0097CEB7 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + A7DF6ECD1D9A1B4A0097CEB7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + A7DF6ECF1D9A1B4A0097CEB7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + A7DF6ED41D9A1B4A0097CEB7 /* MNISTTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MNISTTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + A7DF6EDA1D9A1B4A0097CEB7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + A7DF6EDF1D9A1B4A0097CEB7 /* MNISTUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MNISTUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + A7DF6EE31D9A1B4A0097CEB7 /* MNISTUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MNISTUITests.swift; sourceTree = ""; }; + A7DF6EE51D9A1B4A0097CEB7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + A7DF6EF11D9A1B5B0097CEB7 /* TensorSwift.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = TensorSwift.xcodeproj; path = ../TensorSwift.xcodeproj; sourceTree = ""; }; + A7DF6EFF1D9A1BC90097CEB7 /* Canvas.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Canvas.swift; sourceTree = ""; }; + A7DF6F001D9A1BC90097CEB7 /* CanvasView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CanvasView.swift; sourceTree = ""; }; + A7DF6F011D9A1BC90097CEB7 /* Classifier.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Classifier.swift; sourceTree = ""; }; + A7DF6F021D9A1BC90097CEB7 /* Line.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Line.swift; sourceTree = ""; }; + A7DF6F041D9A1BC90097CEB7 /* b_conv1 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = b_conv1; sourceTree = ""; }; + A7DF6F051D9A1BC90097CEB7 /* b_conv2 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = b_conv2; sourceTree = ""; }; + A7DF6F061D9A1BC90097CEB7 /* b_fc1 */ = {isa = PBXFileReference; lastKnownFileType = file; path = b_fc1; sourceTree = ""; }; + A7DF6F071D9A1BC90097CEB7 /* b_fc2 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = b_fc2; sourceTree = ""; }; + A7DF6F081D9A1BC90097CEB7 /* W_conv1 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = W_conv1; sourceTree = ""; }; + A7DF6F091D9A1BC90097CEB7 /* W_conv2 */ = {isa = PBXFileReference; lastKnownFileType = file; path = W_conv2; sourceTree = ""; }; + A7DF6F0A1D9A1BC90097CEB7 /* W_fc1 */ = {isa = PBXFileReference; lastKnownFileType = file; path = W_fc1; sourceTree = ""; }; + A7DF6F0B1D9A1BC90097CEB7 /* W_fc2 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = W_fc2; sourceTree = ""; }; + A7DF6F0C1D9A1BC90097CEB7 /* String.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = String.swift; sourceTree = ""; }; + A7DF6F1A1D9A1BD90097CEB7 /* MNISTTests-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "MNISTTests-Bridging-Header.h"; sourceTree = ""; }; + A7DF6F1B1D9A1BDA0097CEB7 /* Array.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Array.swift; sourceTree = ""; }; + A7DF6F1C1D9A1BDA0097CEB7 /* ClassifierTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ClassifierTest.swift; sourceTree = ""; }; + A7DF6F1D1D9A1BDA0097CEB7 /* Downloader.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Downloader.swift; sourceTree = ""; }; + A7DF6F1E1D9A1BDA0097CEB7 /* DownloaderTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DownloaderTest.swift; sourceTree = ""; }; + A7DF6F1F1D9A1BDA0097CEB7 /* Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Header.h; sourceTree = ""; }; + A7DF6F201D9A1BDA0097CEB7 /* MNISTTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MNISTTest.swift; sourceTree = ""; }; + A7DF6F211D9A1BDA0097CEB7 /* MNISTTests-Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MNISTTests-Bridging-Header.h"; sourceTree = ""; }; + A7DF6F221D9A1BDA0097CEB7 /* SHA1.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SHA1.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + A7DF6EBD1D9A1B4A0097CEB7 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + A7DF6EFA1D9A1B7D0097CEB7 /* TensorSwift.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A7DF6ED11D9A1B4A0097CEB7 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A7DF6EDC1D9A1B4A0097CEB7 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + A7DF6EB71D9A1B4A0097CEB7 = { + isa = PBXGroup; + children = ( + A7DF6EF11D9A1B5B0097CEB7 /* TensorSwift.xcodeproj */, + A7DF6EC21D9A1B4A0097CEB7 /* MNIST */, + A7DF6ED71D9A1B4A0097CEB7 /* MNISTTests */, + A7DF6EE21D9A1B4A0097CEB7 /* MNISTUITests */, + A7DF6EC11D9A1B4A0097CEB7 /* Products */, + ); + sourceTree = ""; + }; + A7DF6EC11D9A1B4A0097CEB7 /* Products */ = { + isa = PBXGroup; + children = ( + A7DF6EC01D9A1B4A0097CEB7 /* MNIST.app */, + A7DF6ED41D9A1B4A0097CEB7 /* MNISTTests.xctest */, + A7DF6EDF1D9A1B4A0097CEB7 /* MNISTUITests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + A7DF6EC21D9A1B4A0097CEB7 /* MNIST */ = { + isa = PBXGroup; + children = ( + A7DF6EC31D9A1B4A0097CEB7 /* AppDelegate.swift */, + A7DF6EC51D9A1B4A0097CEB7 /* ViewController.swift */, + A7DF6EFF1D9A1BC90097CEB7 /* Canvas.swift */, + A7DF6F001D9A1BC90097CEB7 /* CanvasView.swift */, + A7DF6F011D9A1BC90097CEB7 /* Classifier.swift */, + A7DF6F021D9A1BC90097CEB7 /* Line.swift */, + A7DF6F031D9A1BC90097CEB7 /* Models */, + A7DF6F0C1D9A1BC90097CEB7 /* String.swift */, + A7DF6EC71D9A1B4A0097CEB7 /* Main.storyboard */, + A7DF6ECA1D9A1B4A0097CEB7 /* Assets.xcassets */, + A7DF6ECC1D9A1B4A0097CEB7 /* LaunchScreen.storyboard */, + A7DF6ECF1D9A1B4A0097CEB7 /* Info.plist */, + ); + path = MNIST; + sourceTree = ""; + }; + A7DF6ED71D9A1B4A0097CEB7 /* MNISTTests */ = { + isa = PBXGroup; + children = ( + A7DF6F1B1D9A1BDA0097CEB7 /* Array.swift */, + A7DF6F1C1D9A1BDA0097CEB7 /* ClassifierTest.swift */, + A7DF6F1D1D9A1BDA0097CEB7 /* Downloader.swift */, + A7DF6F1E1D9A1BDA0097CEB7 /* DownloaderTest.swift */, + A7DF6F1F1D9A1BDA0097CEB7 /* Header.h */, + A7DF6F201D9A1BDA0097CEB7 /* MNISTTest.swift */, + A7DF6F211D9A1BDA0097CEB7 /* MNISTTests-Bridging-Header.h */, + A7DF6F221D9A1BDA0097CEB7 /* SHA1.swift */, + A7DF6EDA1D9A1B4A0097CEB7 /* Info.plist */, + A7DF6F1A1D9A1BD90097CEB7 /* MNISTTests-Bridging-Header.h */, + ); + path = MNISTTests; + sourceTree = ""; + }; + A7DF6EE21D9A1B4A0097CEB7 /* MNISTUITests */ = { + isa = PBXGroup; + children = ( + A7DF6EE31D9A1B4A0097CEB7 /* MNISTUITests.swift */, + A7DF6EE51D9A1B4A0097CEB7 /* Info.plist */, + ); + path = MNISTUITests; + sourceTree = ""; + }; + A7DF6EF21D9A1B5B0097CEB7 /* Products */ = { + isa = PBXGroup; + children = ( + A7DF6EF71D9A1B5B0097CEB7 /* TensorSwift.framework */, + A7DF6EF91D9A1B5B0097CEB7 /* TensorSwiftTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + A7DF6F031D9A1BC90097CEB7 /* Models */ = { + isa = PBXGroup; + children = ( + A7DF6F041D9A1BC90097CEB7 /* b_conv1 */, + A7DF6F051D9A1BC90097CEB7 /* b_conv2 */, + A7DF6F061D9A1BC90097CEB7 /* b_fc1 */, + A7DF6F071D9A1BC90097CEB7 /* b_fc2 */, + A7DF6F081D9A1BC90097CEB7 /* W_conv1 */, + A7DF6F091D9A1BC90097CEB7 /* W_conv2 */, + A7DF6F0A1D9A1BC90097CEB7 /* W_fc1 */, + A7DF6F0B1D9A1BC90097CEB7 /* W_fc2 */, + ); + path = Models; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + A7DF6EBF1D9A1B4A0097CEB7 /* MNIST */ = { + isa = PBXNativeTarget; + buildConfigurationList = A7DF6EE81D9A1B4A0097CEB7 /* Build configuration list for PBXNativeTarget "MNIST" */; + buildPhases = ( + A7DF6EBC1D9A1B4A0097CEB7 /* Sources */, + A7DF6EBD1D9A1B4A0097CEB7 /* Frameworks */, + A7DF6EBE1D9A1B4A0097CEB7 /* Resources */, + A7DF6EFE1D9A1B7D0097CEB7 /* Embed Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + A7DF6EFD1D9A1B7D0097CEB7 /* PBXTargetDependency */, + ); + name = MNIST; + productName = MNIST; + productReference = A7DF6EC01D9A1B4A0097CEB7 /* MNIST.app */; + productType = "com.apple.product-type.application"; + }; + A7DF6ED31D9A1B4A0097CEB7 /* MNISTTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = A7DF6EEB1D9A1B4A0097CEB7 /* Build configuration list for PBXNativeTarget "MNISTTests" */; + buildPhases = ( + A7DF6ED01D9A1B4A0097CEB7 /* Sources */, + A7DF6ED11D9A1B4A0097CEB7 /* Frameworks */, + A7DF6ED21D9A1B4A0097CEB7 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + A7DF6ED61D9A1B4A0097CEB7 /* PBXTargetDependency */, + ); + name = MNISTTests; + productName = MNISTTests; + productReference = A7DF6ED41D9A1B4A0097CEB7 /* MNISTTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + A7DF6EDE1D9A1B4A0097CEB7 /* MNISTUITests */ = { + isa = PBXNativeTarget; + buildConfigurationList = A7DF6EEE1D9A1B4A0097CEB7 /* Build configuration list for PBXNativeTarget "MNISTUITests" */; + buildPhases = ( + A7DF6EDB1D9A1B4A0097CEB7 /* Sources */, + A7DF6EDC1D9A1B4A0097CEB7 /* Frameworks */, + A7DF6EDD1D9A1B4A0097CEB7 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + A7DF6EE11D9A1B4A0097CEB7 /* PBXTargetDependency */, + ); + name = MNISTUITests; + productName = MNISTUITests; + productReference = A7DF6EDF1D9A1B4A0097CEB7 /* MNISTUITests.xctest */; + productType = "com.apple.product-type.bundle.ui-testing"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + A7DF6EB81D9A1B4A0097CEB7 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0800; + LastUpgradeCheck = 0800; + ORGANIZATIONNAME = "Araki Takehiro"; + TargetAttributes = { + A7DF6EBF1D9A1B4A0097CEB7 = { + CreatedOnToolsVersion = 8.0; + DevelopmentTeam = 3B8C483UAP; + LastSwiftMigration = 0800; + ProvisioningStyle = Automatic; + }; + A7DF6ED31D9A1B4A0097CEB7 = { + CreatedOnToolsVersion = 8.0; + LastSwiftMigration = 0800; + ProvisioningStyle = Automatic; + TestTargetID = A7DF6EBF1D9A1B4A0097CEB7; + }; + A7DF6EDE1D9A1B4A0097CEB7 = { + CreatedOnToolsVersion = 8.0; + ProvisioningStyle = Automatic; + TestTargetID = A7DF6EBF1D9A1B4A0097CEB7; + }; + }; + }; + buildConfigurationList = A7DF6EBB1D9A1B4A0097CEB7 /* Build configuration list for PBXProject "MNIST" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = A7DF6EB71D9A1B4A0097CEB7; + productRefGroup = A7DF6EC11D9A1B4A0097CEB7 /* Products */; + projectDirPath = ""; + projectReferences = ( + { + ProductGroup = A7DF6EF21D9A1B5B0097CEB7 /* Products */; + ProjectRef = A7DF6EF11D9A1B5B0097CEB7 /* TensorSwift.xcodeproj */; + }, + ); + projectRoot = ""; + targets = ( + A7DF6EBF1D9A1B4A0097CEB7 /* MNIST */, + A7DF6ED31D9A1B4A0097CEB7 /* MNISTTests */, + A7DF6EDE1D9A1B4A0097CEB7 /* MNISTUITests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXReferenceProxy section */ + A7DF6EF71D9A1B5B0097CEB7 /* TensorSwift.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = TensorSwift.framework; + remoteRef = A7DF6EF61D9A1B5B0097CEB7 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + A7DF6EF91D9A1B5B0097CEB7 /* TensorSwiftTests.xctest */ = { + isa = PBXReferenceProxy; + fileType = file; + path = TensorSwiftTests.xctest; + remoteRef = A7DF6EF81D9A1B5B0097CEB7 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; +/* End PBXReferenceProxy section */ + +/* Begin PBXResourcesBuildPhase section */ + A7DF6EBE1D9A1B4A0097CEB7 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + A7DF6F181D9A1BC90097CEB7 /* W_fc2 in Resources */, + A7DF6F131D9A1BC90097CEB7 /* b_fc1 in Resources */, + A7DF6F171D9A1BC90097CEB7 /* W_fc1 in Resources */, + A7DF6F141D9A1BC90097CEB7 /* b_fc2 in Resources */, + A7DF6F121D9A1BC90097CEB7 /* b_conv2 in Resources */, + A7DF6F161D9A1BC90097CEB7 /* W_conv2 in Resources */, + A7DF6ECE1D9A1B4A0097CEB7 /* LaunchScreen.storyboard in Resources */, + A7DF6F151D9A1BC90097CEB7 /* W_conv1 in Resources */, + A7DF6ECB1D9A1B4A0097CEB7 /* Assets.xcassets in Resources */, + A7DF6EC91D9A1B4A0097CEB7 /* Main.storyboard in Resources */, + A7DF6F111D9A1BC90097CEB7 /* b_conv1 in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A7DF6ED21D9A1B4A0097CEB7 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A7DF6EDD1D9A1B4A0097CEB7 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + A7DF6EBC1D9A1B4A0097CEB7 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + A7DF6F0F1D9A1BC90097CEB7 /* Classifier.swift in Sources */, + A7DF6EC61D9A1B4A0097CEB7 /* ViewController.swift in Sources */, + A7DF6EC41D9A1B4A0097CEB7 /* AppDelegate.swift in Sources */, + A7DF6F101D9A1BC90097CEB7 /* Line.swift in Sources */, + A7DF6F191D9A1BC90097CEB7 /* String.swift in Sources */, + A7DF6F0E1D9A1BC90097CEB7 /* CanvasView.swift in Sources */, + A7DF6F0D1D9A1BC90097CEB7 /* Canvas.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A7DF6ED01D9A1B4A0097CEB7 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + A7DF6F241D9A1BDA0097CEB7 /* ClassifierTest.swift in Sources */, + A7DF6F231D9A1BDA0097CEB7 /* Array.swift in Sources */, + A7DF6F281D9A1BDA0097CEB7 /* SHA1.swift in Sources */, + A7DF6F271D9A1BDA0097CEB7 /* MNISTTest.swift in Sources */, + A7DF6F261D9A1BDA0097CEB7 /* DownloaderTest.swift in Sources */, + A7DF6F251D9A1BDA0097CEB7 /* Downloader.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A7DF6EDB1D9A1B4A0097CEB7 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + A7DF6EE41D9A1B4A0097CEB7 /* MNISTUITests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + A7DF6ED61D9A1B4A0097CEB7 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = A7DF6EBF1D9A1B4A0097CEB7 /* MNIST */; + targetProxy = A7DF6ED51D9A1B4A0097CEB7 /* PBXContainerItemProxy */; + }; + A7DF6EE11D9A1B4A0097CEB7 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = A7DF6EBF1D9A1B4A0097CEB7 /* MNIST */; + targetProxy = A7DF6EE01D9A1B4A0097CEB7 /* PBXContainerItemProxy */; + }; + A7DF6EFD1D9A1B7D0097CEB7 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = TensorSwift; + targetProxy = A7DF6EFC1D9A1B7D0097CEB7 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + A7DF6EC71D9A1B4A0097CEB7 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + A7DF6EC81D9A1B4A0097CEB7 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + A7DF6ECC1D9A1B4A0097CEB7 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + A7DF6ECD1D9A1B4A0097CEB7 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + A7DF6EE61D9A1B4A0097CEB7 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + A7DF6EE71D9A1B4A0097CEB7 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + A7DF6EE91D9A1B4A0097CEB7 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + DEVELOPMENT_TEAM = 3B8C483UAP; + INFOPLIST_FILE = MNIST/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = jp.co.qoncept.MNIST; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; + }; + name = Debug; + }; + A7DF6EEA1D9A1B4A0097CEB7 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + DEVELOPMENT_TEAM = 3B8C483UAP; + INFOPLIST_FILE = MNIST/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = jp.co.qoncept.MNIST; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; + }; + name = Release; + }; + A7DF6EEC1D9A1B4A0097CEB7 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + CLANG_ENABLE_MODULES = YES; + INFOPLIST_FILE = MNISTTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = jp.co.qoncept.MNISTTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "MNISTTests/MNISTTests-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 3.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/MNIST.app/MNIST"; + }; + name = Debug; + }; + A7DF6EED1D9A1B4A0097CEB7 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + CLANG_ENABLE_MODULES = YES; + INFOPLIST_FILE = MNISTTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = jp.co.qoncept.MNISTTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "MNISTTests/MNISTTests-Bridging-Header.h"; + SWIFT_VERSION = 3.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/MNIST.app/MNIST"; + }; + name = Release; + }; + A7DF6EEF1D9A1B4A0097CEB7 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + INFOPLIST_FILE = MNISTUITests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = jp.co.qoncept.MNISTUITests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; + TEST_TARGET_NAME = MNIST; + }; + name = Debug; + }; + A7DF6EF01D9A1B4A0097CEB7 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + INFOPLIST_FILE = MNISTUITests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = jp.co.qoncept.MNISTUITests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; + TEST_TARGET_NAME = MNIST; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + A7DF6EBB1D9A1B4A0097CEB7 /* Build configuration list for PBXProject "MNIST" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + A7DF6EE61D9A1B4A0097CEB7 /* Debug */, + A7DF6EE71D9A1B4A0097CEB7 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + A7DF6EE81D9A1B4A0097CEB7 /* Build configuration list for PBXNativeTarget "MNIST" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + A7DF6EE91D9A1B4A0097CEB7 /* Debug */, + A7DF6EEA1D9A1B4A0097CEB7 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; + A7DF6EEB1D9A1B4A0097CEB7 /* Build configuration list for PBXNativeTarget "MNISTTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + A7DF6EEC1D9A1B4A0097CEB7 /* Debug */, + A7DF6EED1D9A1B4A0097CEB7 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; + A7DF6EEE1D9A1B4A0097CEB7 /* Build configuration list for PBXNativeTarget "MNISTUITests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + A7DF6EEF1D9A1B4A0097CEB7 /* Debug */, + A7DF6EF01D9A1B4A0097CEB7 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; +/* End XCConfigurationList section */ + }; + rootObject = A7DF6EB81D9A1B4A0097CEB7 /* Project object */; +} diff --git a/MNIST/MNIST.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/MNIST/MNIST.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..f66f8a3 --- /dev/null +++ b/MNIST/MNIST.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/MNIST/AppDelegate.swift b/MNIST/MNIST/AppDelegate.swift similarity index 76% rename from MNIST/AppDelegate.swift rename to MNIST/MNIST/AppDelegate.swift index f70ff9a..d386cb2 100644 --- a/MNIST/AppDelegate.swift +++ b/MNIST/MNIST/AppDelegate.swift @@ -6,30 +6,30 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? - func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } - func applicationWillResignActive(application: UIApplication) { + func applicationWillResignActive(_ application: UIApplication) { // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. } - func applicationDidEnterBackground(application: UIApplication) { + func applicationDidEnterBackground(_ application: UIApplication) { // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } - func applicationWillEnterForeground(application: UIApplication) { + func applicationWillEnterForeground(_ application: UIApplication) { // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. } - func applicationDidBecomeActive(application: UIApplication) { + func applicationDidBecomeActive(_ application: UIApplication) { // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. } - func applicationWillTerminate(application: UIApplication) { + func applicationWillTerminate(_ application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } diff --git a/MNIST/Assets.xcassets/AppIcon.appiconset/Contents.json b/MNIST/MNIST/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from MNIST/Assets.xcassets/AppIcon.appiconset/Contents.json rename to MNIST/MNIST/Assets.xcassets/AppIcon.appiconset/Contents.json diff --git a/MNIST/Base.lproj/LaunchScreen.storyboard b/MNIST/MNIST/Base.lproj/LaunchScreen.storyboard similarity index 100% rename from MNIST/Base.lproj/LaunchScreen.storyboard rename to MNIST/MNIST/Base.lproj/LaunchScreen.storyboard diff --git a/MNIST/Base.lproj/Main.storyboard b/MNIST/MNIST/Base.lproj/Main.storyboard similarity index 100% rename from MNIST/Base.lproj/Main.storyboard rename to MNIST/MNIST/Base.lproj/Main.storyboard diff --git a/MNIST/Canvas.swift b/MNIST/MNIST/Canvas.swift similarity index 82% rename from MNIST/Canvas.swift rename to MNIST/MNIST/Canvas.swift index 064975c..51f20a5 100644 --- a/MNIST/Canvas.swift +++ b/MNIST/MNIST/Canvas.swift @@ -3,11 +3,11 @@ import CoreGraphics struct Canvas { var lines: [Line] = [Line()] - mutating func draw(point: CGPoint) { + mutating func draw(_ point: CGPoint) { lines[lines.endIndex - 1].points.append(point) } mutating func newLine() { lines.append(Line()) } -} \ No newline at end of file +} diff --git a/MNIST/MNIST/CanvasView.swift b/MNIST/MNIST/CanvasView.swift new file mode 100644 index 0000000..a4e45be --- /dev/null +++ b/MNIST/MNIST/CanvasView.swift @@ -0,0 +1,52 @@ +import UIKit + +class CanvasView: UIView { + fileprivate(set) var canvas: Canvas + + required init?(coder: NSCoder) { + canvas = Canvas() + super.init(coder: coder) + + self.addGestureRecognizer(UIPanGestureRecognizer(target: self, action: #selector(CanvasView.onPanGesture(_:)))) + } + + var image: UIImage { + UIGraphicsBeginImageContext(bounds.size) + layer.render(in: UIGraphicsGetCurrentContext()!) + let result = UIGraphicsGetImageFromCurrentImageContext() + UIGraphicsEndImageContext() + return result! + } + + override func draw(_ rect: CGRect) { + let context = UIGraphicsGetCurrentContext() + for line in canvas.lines { + context?.setLineWidth(20.0) + context?.setStrokeColor(UIColor(colorLiteralRed: 0.0, green: 0.0, blue: 0.0, alpha: 1.0).cgColor) + context?.setLineCap(.round) + context?.setLineJoin(.round) + for (index, point) in line.points.enumerated() { + if index == 0 { + context?.move(to: CGPoint(x: point.x, y: point.y)) + } else { + context?.addLine(to: CGPoint(x: point.x, y: point.y)) + } + } + } + context?.strokePath() + } + + func onPanGesture(_ gestureRecognizer: UIPanGestureRecognizer) { + canvas.draw(gestureRecognizer.location(in: self)) + if gestureRecognizer.state == .ended { + canvas.newLine() + } + + setNeedsDisplay() + } + + func clear() { + canvas = Canvas() + setNeedsDisplay() + } +} diff --git a/MNIST/Classifier.swift b/MNIST/MNIST/Classifier.swift similarity index 81% rename from MNIST/Classifier.swift rename to MNIST/MNIST/Classifier.swift index a966ec6..346b791 100644 --- a/MNIST/Classifier.swift +++ b/MNIST/MNIST/Classifier.swift @@ -11,7 +11,7 @@ public struct Classifier { public let W_fc2: Tensor public let b_fc2: Tensor - public func classify(x_image: Tensor) -> Int { + public func classify(_ x_image: Tensor) -> Int { let h_conv1 = (x_image.conv2d(filter: W_conv1, strides: [1, 1, 1]) + b_conv1).relu let h_pool1 = h_conv1.maxPool(kernelSize: [2, 2, 1], strides: [2, 2, 1]) @@ -23,7 +23,7 @@ public struct Classifier { let y_conv = (h_fc1.matmul(W_fc2) + b_fc2).softmax - return y_conv.elements.enumerate().maxElement { $0.1 < $1.1 }!.0 + return y_conv.elements.enumerated().max { $0.1 < $1.1 }!.0 } } @@ -40,7 +40,7 @@ extension Classifier { } } -private func loadFloatArray(directory directory: String, file: String) -> [Float] { - let data = NSData(contentsOfFile: directory.stringByAppendingPathComponent(file))! - return Array(UnsafeBufferPointer(start: UnsafeMutablePointer(data.bytes), count: data.length / 4)) +private func loadFloatArray(directory: String, file: String) -> [Float] { + let data = try! Data(contentsOf: URL(fileURLWithPath: directory.stringByAppendingPathComponent(file))) + return Array(UnsafeBufferPointer(start: UnsafeMutablePointer(mutating: (data as NSData).bytes.bindMemory(to: Float.self, capacity: data.count)), count: data.count / 4)) } diff --git a/MNIST/Info.plist b/MNIST/MNIST/Info.plist similarity index 100% rename from MNIST/Info.plist rename to MNIST/MNIST/Info.plist diff --git a/MNIST/Line.swift b/MNIST/MNIST/Line.swift similarity index 100% rename from MNIST/Line.swift rename to MNIST/MNIST/Line.swift diff --git a/MNIST/Models/W_conv1 b/MNIST/MNIST/Models/W_conv1 similarity index 100% rename from MNIST/Models/W_conv1 rename to MNIST/MNIST/Models/W_conv1 diff --git a/MNIST/Models/W_conv2 b/MNIST/MNIST/Models/W_conv2 similarity index 100% rename from MNIST/Models/W_conv2 rename to MNIST/MNIST/Models/W_conv2 diff --git a/MNIST/Models/W_fc1 b/MNIST/MNIST/Models/W_fc1 similarity index 100% rename from MNIST/Models/W_fc1 rename to MNIST/MNIST/Models/W_fc1 diff --git a/MNIST/Models/W_fc2 b/MNIST/MNIST/Models/W_fc2 similarity index 100% rename from MNIST/Models/W_fc2 rename to MNIST/MNIST/Models/W_fc2 diff --git a/MNIST/Models/b_conv1 b/MNIST/MNIST/Models/b_conv1 similarity index 100% rename from MNIST/Models/b_conv1 rename to MNIST/MNIST/Models/b_conv1 diff --git a/MNIST/Models/b_conv2 b/MNIST/MNIST/Models/b_conv2 similarity index 100% rename from MNIST/Models/b_conv2 rename to MNIST/MNIST/Models/b_conv2 diff --git a/MNIST/Models/b_fc1 b/MNIST/MNIST/Models/b_fc1 similarity index 100% rename from MNIST/Models/b_fc1 rename to MNIST/MNIST/Models/b_fc1 diff --git a/MNIST/Models/b_fc2 b/MNIST/MNIST/Models/b_fc2 similarity index 100% rename from MNIST/Models/b_fc2 rename to MNIST/MNIST/Models/b_fc2 diff --git a/MNIST/MNIST/String.swift b/MNIST/MNIST/String.swift new file mode 100644 index 0000000..309c9aa --- /dev/null +++ b/MNIST/MNIST/String.swift @@ -0,0 +1,7 @@ +import Foundation + +extension String { + public func stringByAppendingPathComponent(_ str: String) -> String { + return (self as NSString).appendingPathComponent(str) + } +} diff --git a/MNIST/MNIST/ViewController.swift b/MNIST/MNIST/ViewController.swift new file mode 100644 index 0000000..0b65b8d --- /dev/null +++ b/MNIST/MNIST/ViewController.swift @@ -0,0 +1,35 @@ +import UIKit +import TensorSwift + +class ViewController: UIViewController { + @IBOutlet fileprivate var canvasView: CanvasView! + + fileprivate let inputSize = 28 + fileprivate let classifier = Classifier(path: Bundle.main.resourcePath!) + + @IBAction func onPressClassifyButton(_ sender: UIButton) { + let input: Tensor + do { + let image = canvasView.image + + let cgImage = image.cgImage! + + var pixels = [UInt8](repeating: 0, count: inputSize * inputSize) + + let context = CGContext(data: &pixels, width: inputSize, height: inputSize, bitsPerComponent: 8, bytesPerRow: inputSize, space: CGColorSpaceCreateDeviceGray(), bitmapInfo: 0)! + context.clear(CGRect(x: 0.0, y: 0.0, width: CGFloat(inputSize), height: CGFloat(inputSize))) + + let rect = CGRect(x: 0.0, y: 0.0, width: CGFloat(inputSize), height: CGFloat(inputSize)) + context.draw(cgImage, in: rect) + + input = Tensor(shape: [Dimension(inputSize), Dimension(inputSize), 1], elements: pixels.map { -(Float($0) / 255.0 - 0.5) + 0.5 }) + } + + let estimatedLabel = classifier.classify(input) + + let alertController = UIAlertController(title: "\(estimatedLabel)", message: nil, preferredStyle: .alert) + alertController.addAction(UIAlertAction(title: "Dismiss", style: .default) { _ in self.canvasView.clear() }) + present(alertController, animated: true, completion: nil) + } +} + diff --git a/MNISTTests/Array.swift b/MNIST/MNISTTests/Array.swift similarity index 100% rename from MNISTTests/Array.swift rename to MNIST/MNISTTests/Array.swift diff --git a/MNISTTests/ClassifierTest.swift b/MNIST/MNISTTests/ClassifierTest.swift similarity index 100% rename from MNISTTests/ClassifierTest.swift rename to MNIST/MNISTTests/ClassifierTest.swift diff --git a/MNISTTests/Downloader.swift b/MNIST/MNISTTests/Downloader.swift similarity index 100% rename from MNISTTests/Downloader.swift rename to MNIST/MNISTTests/Downloader.swift diff --git a/MNISTTests/DownloaderTest.swift b/MNIST/MNISTTests/DownloaderTest.swift similarity index 100% rename from MNISTTests/DownloaderTest.swift rename to MNIST/MNISTTests/DownloaderTest.swift diff --git a/MNISTTests/Header.h b/MNIST/MNISTTests/Header.h similarity index 100% rename from MNISTTests/Header.h rename to MNIST/MNISTTests/Header.h diff --git a/MNISTTests/Info.plist b/MNIST/MNISTTests/Info.plist similarity index 100% rename from MNISTTests/Info.plist rename to MNIST/MNISTTests/Info.plist diff --git a/MNISTTests/MNISTTest.swift b/MNIST/MNISTTests/MNISTTest.swift similarity index 100% rename from MNISTTests/MNISTTest.swift rename to MNIST/MNISTTests/MNISTTest.swift diff --git a/MNISTTests/MNISTTests-Bridging-Header.h b/MNIST/MNISTTests/MNISTTests-Bridging-Header.h similarity index 100% rename from MNISTTests/MNISTTests-Bridging-Header.h rename to MNIST/MNISTTests/MNISTTests-Bridging-Header.h diff --git a/MNISTTests/SHA1.swift b/MNIST/MNISTTests/SHA1.swift similarity index 100% rename from MNISTTests/SHA1.swift rename to MNIST/MNISTTests/SHA1.swift diff --git a/MNIST/MNISTUITests/Info.plist b/MNIST/MNISTUITests/Info.plist new file mode 100644 index 0000000..6c6c23c --- /dev/null +++ b/MNIST/MNISTUITests/Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + + diff --git a/MNIST/MNISTUITests/MNISTUITests.swift b/MNIST/MNISTUITests/MNISTUITests.swift new file mode 100644 index 0000000..325de47 --- /dev/null +++ b/MNIST/MNISTUITests/MNISTUITests.swift @@ -0,0 +1,36 @@ +// +// MNISTUITests.swift +// MNISTUITests +// +// Created by Araki Takehiro on 2016/09/27. +// Copyright © 2016年 Araki Takehiro. All rights reserved. +// + +import XCTest + +class MNISTUITests: XCTestCase { + + override func setUp() { + super.setUp() + + // Put setup code here. This method is called before the invocation of each test method in the class. + + // In UI tests it is usually best to stop immediately when a failure occurs. + continueAfterFailure = false + // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. + XCUIApplication().launch() + + // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. + } + + override func tearDown() { + // Put teardown code here. This method is called after the invocation of each test method in the class. + super.tearDown() + } + + func testExample() { + // Use recording to get started writing UI tests. + // Use XCTAssert and related functions to verify your tests produce the correct results. + } + +} diff --git a/MNIST/String.swift b/MNIST/String.swift deleted file mode 100644 index f255dc2..0000000 --- a/MNIST/String.swift +++ /dev/null @@ -1,7 +0,0 @@ -import Foundation - -extension String { - public func stringByAppendingPathComponent(str: String) -> String { - return (self as NSString).stringByAppendingPathComponent(str) - } -} \ No newline at end of file diff --git a/MNIST/ViewController.swift b/MNIST/ViewController.swift deleted file mode 100644 index 149f83c..0000000 --- a/MNIST/ViewController.swift +++ /dev/null @@ -1,35 +0,0 @@ -import UIKit -import TensorSwift - -class ViewController: UIViewController { - @IBOutlet private var canvasView: CanvasView! - - private let inputSize = 28 - private let classifier = Classifier(path: NSBundle.mainBundle().resourcePath!) - - @IBAction func onPressClassifyButton(sender: UIButton) { - let input: Tensor - do { - let image = canvasView.image - - let cgImage = image.CGImage! - - var pixels = [UInt8](count: inputSize * inputSize, repeatedValue: 0) - - let context = CGBitmapContextCreate(&pixels, inputSize, inputSize, 8, inputSize, CGColorSpaceCreateDeviceGray()!, CGBitmapInfo.ByteOrderDefault.rawValue)! - CGContextClearRect(context, CGRect(x: 0.0, y: 0.0, width: CGFloat(inputSize), height: CGFloat(inputSize))) - - let rect = CGRect(x: 0.0, y: 0.0, width: CGFloat(inputSize), height: CGFloat(inputSize)) - CGContextDrawImage(context, rect, cgImage) - - input = Tensor(shape: [Dimension(inputSize), Dimension(inputSize), 1], elements: pixels.map { -(Float($0) / 255.0 - 0.5) + 0.5 }) - } - - let estimatedLabel = classifier.classify(input) - - let alertController = UIAlertController(title: "\(estimatedLabel)", message: nil, preferredStyle: .Alert) - alertController.addAction(UIAlertAction(title: "Dismiss", style: .Default) { _ in self.canvasView.clear() }) - presentViewController(alertController, animated: true, completion: nil) - } -} - From bc7a804d69d90e5d4a4fb77c2dce50d22b6800a4 Mon Sep 17 00:00:00 2001 From: araki Date: Tue, 27 Sep 2016 13:48:31 +0900 Subject: [PATCH 04/26] Make MNISTTests executable. --- MNIST/MNIST.xcodeproj/project.pbxproj | 140 ++++-------------- MNIST/MNIST/Classifier.swift | 18 +-- MNIST/MNISTTests/Array.swift | 4 +- MNIST/MNISTTests/ClassifierTest.swift | 30 +++- MNIST/MNISTTests/Downloader.swift | 34 +++-- MNIST/MNISTTests/DownloaderTest.swift | 2 +- MNIST/MNISTTests/Header.h | 1 - MNIST/MNISTTests/MNISTTests-Bridging-Header.h | 2 + MNIST/MNISTTests/SHA1.swift | 8 +- MNIST/MNISTUITests/Info.plist | 22 --- MNIST/MNISTUITests/MNISTUITests.swift | 36 ----- zlib/include.h | 1 - zlib/module.modulemap | 4 - 13 files changed, 86 insertions(+), 216 deletions(-) delete mode 100644 MNIST/MNISTUITests/Info.plist delete mode 100644 MNIST/MNISTUITests/MNISTUITests.swift delete mode 100755 zlib/include.h delete mode 100755 zlib/module.modulemap diff --git a/MNIST/MNIST.xcodeproj/project.pbxproj b/MNIST/MNIST.xcodeproj/project.pbxproj index 891c1c8..6af9478 100644 --- a/MNIST/MNIST.xcodeproj/project.pbxproj +++ b/MNIST/MNIST.xcodeproj/project.pbxproj @@ -12,7 +12,6 @@ A7DF6EC91D9A1B4A0097CEB7 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A7DF6EC71D9A1B4A0097CEB7 /* Main.storyboard */; }; A7DF6ECB1D9A1B4A0097CEB7 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A7DF6ECA1D9A1B4A0097CEB7 /* Assets.xcassets */; }; A7DF6ECE1D9A1B4A0097CEB7 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A7DF6ECC1D9A1B4A0097CEB7 /* LaunchScreen.storyboard */; }; - A7DF6EE41D9A1B4A0097CEB7 /* MNISTUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7DF6EE31D9A1B4A0097CEB7 /* MNISTUITests.swift */; }; A7DF6EFA1D9A1B7D0097CEB7 /* TensorSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A7DF6EF71D9A1B5B0097CEB7 /* TensorSwift.framework */; }; A7DF6EFB1D9A1B7D0097CEB7 /* TensorSwift.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = A7DF6EF71D9A1B5B0097CEB7 /* TensorSwift.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; A7DF6F0D1D9A1BC90097CEB7 /* Canvas.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7DF6EFF1D9A1BC90097CEB7 /* Canvas.swift */; }; @@ -34,6 +33,8 @@ A7DF6F261D9A1BDA0097CEB7 /* DownloaderTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7DF6F1E1D9A1BDA0097CEB7 /* DownloaderTest.swift */; }; A7DF6F271D9A1BDA0097CEB7 /* MNISTTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7DF6F201D9A1BDA0097CEB7 /* MNISTTest.swift */; }; A7DF6F281D9A1BDA0097CEB7 /* SHA1.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7DF6F221D9A1BDA0097CEB7 /* SHA1.swift */; }; + A7DF6F2F1D9A24650097CEB7 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = A7DF6F2D1D9A1DA40097CEB7 /* libz.tbd */; }; + A7DF6F351D9A26180097CEB7 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = A7DF6F2D1D9A1DA40097CEB7 /* libz.tbd */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -44,13 +45,6 @@ remoteGlobalIDString = A7DF6EBF1D9A1B4A0097CEB7; remoteInfo = MNIST; }; - A7DF6EE01D9A1B4A0097CEB7 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = A7DF6EB81D9A1B4A0097CEB7 /* Project object */; - proxyType = 1; - remoteGlobalIDString = A7DF6EBF1D9A1B4A0097CEB7; - remoteInfo = MNIST; - }; A7DF6EF61D9A1B5B0097CEB7 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = A7DF6EF11D9A1B5B0097CEB7 /* TensorSwift.xcodeproj */; @@ -98,9 +92,6 @@ A7DF6ECF1D9A1B4A0097CEB7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; A7DF6ED41D9A1B4A0097CEB7 /* MNISTTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MNISTTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; A7DF6EDA1D9A1B4A0097CEB7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - A7DF6EDF1D9A1B4A0097CEB7 /* MNISTUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MNISTUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - A7DF6EE31D9A1B4A0097CEB7 /* MNISTUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MNISTUITests.swift; sourceTree = ""; }; - A7DF6EE51D9A1B4A0097CEB7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; A7DF6EF11D9A1B5B0097CEB7 /* TensorSwift.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = TensorSwift.xcodeproj; path = ../TensorSwift.xcodeproj; sourceTree = ""; }; A7DF6EFF1D9A1BC90097CEB7 /* Canvas.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Canvas.swift; sourceTree = ""; }; A7DF6F001D9A1BC90097CEB7 /* CanvasView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CanvasView.swift; sourceTree = ""; }; @@ -122,8 +113,8 @@ A7DF6F1E1D9A1BDA0097CEB7 /* DownloaderTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DownloaderTest.swift; sourceTree = ""; }; A7DF6F1F1D9A1BDA0097CEB7 /* Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Header.h; sourceTree = ""; }; A7DF6F201D9A1BDA0097CEB7 /* MNISTTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MNISTTest.swift; sourceTree = ""; }; - A7DF6F211D9A1BDA0097CEB7 /* MNISTTests-Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MNISTTests-Bridging-Header.h"; sourceTree = ""; }; A7DF6F221D9A1BDA0097CEB7 /* SHA1.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SHA1.swift; sourceTree = ""; }; + A7DF6F2D1D9A1DA40097CEB7 /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -131,6 +122,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + A7DF6F2F1D9A24650097CEB7 /* libz.tbd in Frameworks */, A7DF6EFA1D9A1B7D0097CEB7 /* TensorSwift.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -139,13 +131,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - A7DF6EDC1D9A1B4A0097CEB7 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( + A7DF6F351D9A26180097CEB7 /* libz.tbd in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -158,8 +144,8 @@ A7DF6EF11D9A1B5B0097CEB7 /* TensorSwift.xcodeproj */, A7DF6EC21D9A1B4A0097CEB7 /* MNIST */, A7DF6ED71D9A1B4A0097CEB7 /* MNISTTests */, - A7DF6EE21D9A1B4A0097CEB7 /* MNISTUITests */, A7DF6EC11D9A1B4A0097CEB7 /* Products */, + A7DF6F2C1D9A1DA40097CEB7 /* Frameworks */, ); sourceTree = ""; }; @@ -168,7 +154,6 @@ children = ( A7DF6EC01D9A1B4A0097CEB7 /* MNIST.app */, A7DF6ED41D9A1B4A0097CEB7 /* MNISTTests.xctest */, - A7DF6EDF1D9A1B4A0097CEB7 /* MNISTUITests.xctest */, ); name = Products; sourceTree = ""; @@ -196,12 +181,11 @@ isa = PBXGroup; children = ( A7DF6F1B1D9A1BDA0097CEB7 /* Array.swift */, - A7DF6F1C1D9A1BDA0097CEB7 /* ClassifierTest.swift */, A7DF6F1D1D9A1BDA0097CEB7 /* Downloader.swift */, A7DF6F1E1D9A1BDA0097CEB7 /* DownloaderTest.swift */, + A7DF6F1C1D9A1BDA0097CEB7 /* ClassifierTest.swift */, A7DF6F1F1D9A1BDA0097CEB7 /* Header.h */, A7DF6F201D9A1BDA0097CEB7 /* MNISTTest.swift */, - A7DF6F211D9A1BDA0097CEB7 /* MNISTTests-Bridging-Header.h */, A7DF6F221D9A1BDA0097CEB7 /* SHA1.swift */, A7DF6EDA1D9A1B4A0097CEB7 /* Info.plist */, A7DF6F1A1D9A1BD90097CEB7 /* MNISTTests-Bridging-Header.h */, @@ -209,15 +193,6 @@ path = MNISTTests; sourceTree = ""; }; - A7DF6EE21D9A1B4A0097CEB7 /* MNISTUITests */ = { - isa = PBXGroup; - children = ( - A7DF6EE31D9A1B4A0097CEB7 /* MNISTUITests.swift */, - A7DF6EE51D9A1B4A0097CEB7 /* Info.plist */, - ); - path = MNISTUITests; - sourceTree = ""; - }; A7DF6EF21D9A1B5B0097CEB7 /* Products */ = { isa = PBXGroup; children = ( @@ -242,6 +217,14 @@ path = Models; sourceTree = ""; }; + A7DF6F2C1D9A1DA40097CEB7 /* Frameworks */ = { + isa = PBXGroup; + children = ( + A7DF6F2D1D9A1DA40097CEB7 /* libz.tbd */, + ); + name = Frameworks; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -282,24 +265,6 @@ productReference = A7DF6ED41D9A1B4A0097CEB7 /* MNISTTests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; - A7DF6EDE1D9A1B4A0097CEB7 /* MNISTUITests */ = { - isa = PBXNativeTarget; - buildConfigurationList = A7DF6EEE1D9A1B4A0097CEB7 /* Build configuration list for PBXNativeTarget "MNISTUITests" */; - buildPhases = ( - A7DF6EDB1D9A1B4A0097CEB7 /* Sources */, - A7DF6EDC1D9A1B4A0097CEB7 /* Frameworks */, - A7DF6EDD1D9A1B4A0097CEB7 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - A7DF6EE11D9A1B4A0097CEB7 /* PBXTargetDependency */, - ); - name = MNISTUITests; - productName = MNISTUITests; - productReference = A7DF6EDF1D9A1B4A0097CEB7 /* MNISTUITests.xctest */; - productType = "com.apple.product-type.bundle.ui-testing"; - }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ @@ -312,7 +277,6 @@ TargetAttributes = { A7DF6EBF1D9A1B4A0097CEB7 = { CreatedOnToolsVersion = 8.0; - DevelopmentTeam = 3B8C483UAP; LastSwiftMigration = 0800; ProvisioningStyle = Automatic; }; @@ -322,11 +286,6 @@ ProvisioningStyle = Automatic; TestTargetID = A7DF6EBF1D9A1B4A0097CEB7; }; - A7DF6EDE1D9A1B4A0097CEB7 = { - CreatedOnToolsVersion = 8.0; - ProvisioningStyle = Automatic; - TestTargetID = A7DF6EBF1D9A1B4A0097CEB7; - }; }; }; buildConfigurationList = A7DF6EBB1D9A1B4A0097CEB7 /* Build configuration list for PBXProject "MNIST" */; @@ -350,7 +309,6 @@ targets = ( A7DF6EBF1D9A1B4A0097CEB7 /* MNIST */, A7DF6ED31D9A1B4A0097CEB7 /* MNISTTests */, - A7DF6EDE1D9A1B4A0097CEB7 /* MNISTUITests */, ); }; /* End PBXProject section */ @@ -398,13 +356,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - A7DF6EDD1D9A1B4A0097CEB7 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -435,14 +386,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - A7DF6EDB1D9A1B4A0097CEB7 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - A7DF6EE41D9A1B4A0097CEB7 /* MNISTUITests.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ @@ -451,11 +394,6 @@ target = A7DF6EBF1D9A1B4A0097CEB7 /* MNIST */; targetProxy = A7DF6ED51D9A1B4A0097CEB7 /* PBXContainerItemProxy */; }; - A7DF6EE11D9A1B4A0097CEB7 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = A7DF6EBF1D9A1B4A0097CEB7 /* MNIST */; - targetProxy = A7DF6EE01D9A1B4A0097CEB7 /* PBXContainerItemProxy */; - }; A7DF6EFD1D9A1B7D0097CEB7 /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = TensorSwift; @@ -523,7 +461,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -567,7 +505,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; @@ -581,12 +519,14 @@ buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - DEVELOPMENT_TEAM = 3B8C483UAP; + DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = MNIST/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + OTHER_LDFLAGS = ""; PRODUCT_BUNDLE_IDENTIFIER = jp.co.qoncept.MNIST; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_INCLUDE_PATHS = ""; SWIFT_VERSION = 3.0; }; name = Debug; @@ -596,12 +536,14 @@ buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - DEVELOPMENT_TEAM = 3B8C483UAP; + DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = MNIST/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + OTHER_LDFLAGS = ""; PRODUCT_BUNDLE_IDENTIFIER = jp.co.qoncept.MNIST; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_INCLUDE_PATHS = ""; SWIFT_VERSION = 3.0; }; name = Release; @@ -612,6 +554,7 @@ ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; BUNDLE_LOADER = "$(TEST_HOST)"; CLANG_ENABLE_MODULES = YES; + DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = MNISTTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = jp.co.qoncept.MNISTTests; @@ -629,6 +572,7 @@ ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; BUNDLE_LOADER = "$(TEST_HOST)"; CLANG_ENABLE_MODULES = YES; + DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = MNISTTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = jp.co.qoncept.MNISTTests; @@ -639,32 +583,6 @@ }; name = Release; }; - A7DF6EEF1D9A1B4A0097CEB7 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; - INFOPLIST_FILE = MNISTUITests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = jp.co.qoncept.MNISTUITests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; - TEST_TARGET_NAME = MNIST; - }; - name = Debug; - }; - A7DF6EF01D9A1B4A0097CEB7 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; - INFOPLIST_FILE = MNISTUITests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = jp.co.qoncept.MNISTUITests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; - TEST_TARGET_NAME = MNIST; - }; - name = Release; - }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -693,14 +611,6 @@ ); defaultConfigurationIsVisible = 0; }; - A7DF6EEE1D9A1B4A0097CEB7 /* Build configuration list for PBXNativeTarget "MNISTUITests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - A7DF6EEF1D9A1B4A0097CEB7 /* Debug */, - A7DF6EF01D9A1B4A0097CEB7 /* Release */, - ); - defaultConfigurationIsVisible = 0; - }; /* End XCConfigurationList section */ }; rootObject = A7DF6EB81D9A1B4A0097CEB7 /* Project object */; diff --git a/MNIST/MNIST/Classifier.swift b/MNIST/MNIST/Classifier.swift index 346b791..3618bea 100644 --- a/MNIST/MNIST/Classifier.swift +++ b/MNIST/MNIST/Classifier.swift @@ -29,18 +29,18 @@ public struct Classifier { extension Classifier { public init(path: String) { - W_conv1 = Tensor(shape: [5, 5, 1, 32], elements: loadFloatArray(directory: path, file: "W_conv1")) - b_conv1 = Tensor(shape: [32], elements: loadFloatArray(directory: path, file: "b_conv1")) - W_conv2 = Tensor(shape: [5, 5, 32, 64], elements: loadFloatArray(directory: path, file: "W_conv2")) - b_conv2 = Tensor(shape: [64], elements: loadFloatArray(directory: path, file: "b_conv2")) - W_fc1 = Tensor(shape: [7 * 7 * 64, 1024], elements: loadFloatArray(directory: path, file: "W_fc1")) - b_fc1 = Tensor(shape: [1024], elements: loadFloatArray(directory: path, file: "b_fc1")) - W_fc2 = Tensor(shape: [1024, 10], elements: loadFloatArray(directory: path, file: "W_fc2")) - b_fc2 = Tensor(shape: [10], elements: loadFloatArray(directory: path, file: "b_fc2")) + W_conv1 = Tensor(shape: [5, 5, 1, 32], elements: loadFloatArray(path, file: "W_conv1")) + b_conv1 = Tensor(shape: [32], elements: loadFloatArray(path, file: "b_conv1")) + W_conv2 = Tensor(shape: [5, 5, 32, 64], elements: loadFloatArray(path, file: "W_conv2")) + b_conv2 = Tensor(shape: [64], elements: loadFloatArray(path, file: "b_conv2")) + W_fc1 = Tensor(shape: [7 * 7 * 64, 1024], elements: loadFloatArray(path, file: "W_fc1")) + b_fc1 = Tensor(shape: [1024], elements: loadFloatArray(path, file: "b_fc1")) + W_fc2 = Tensor(shape: [1024, 10], elements: loadFloatArray(path, file: "W_fc2")) + b_fc2 = Tensor(shape: [10], elements: loadFloatArray(path, file: "b_fc2")) } } -private func loadFloatArray(directory: String, file: String) -> [Float] { +private func loadFloatArray(_ directory: String, file: String) -> [Float] { let data = try! Data(contentsOf: URL(fileURLWithPath: directory.stringByAppendingPathComponent(file))) return Array(UnsafeBufferPointer(start: UnsafeMutablePointer(mutating: (data as NSData).bytes.bindMemory(to: Float.self, capacity: data.count)), count: data.count / 4)) } diff --git a/MNIST/MNISTTests/Array.swift b/MNIST/MNISTTests/Array.swift index e519774..166d8a5 100644 --- a/MNIST/MNISTTests/Array.swift +++ b/MNIST/MNISTTests/Array.swift @@ -1,5 +1,5 @@ extension Array { - func grouped(count: Int) -> [[Element]] { + func grouped(_ count: Int) -> [[Element]] { var result: [[Element]] = [] var group: [Element] = [] for element in self { @@ -11,4 +11,4 @@ extension Array { } return result } -} \ No newline at end of file +} diff --git a/MNIST/MNISTTests/ClassifierTest.swift b/MNIST/MNISTTests/ClassifierTest.swift index 5bb3e96..a631469 100644 --- a/MNIST/MNISTTests/ClassifierTest.swift +++ b/MNIST/MNISTTests/ClassifierTest.swift @@ -1,17 +1,35 @@ import XCTest import TensorSwift -import MNIST +@testable import MNIST class ClassifierTest: XCTestCase { func testClassify() { - let classifier = Classifier(path: NSBundle(forClass: ClassifierTest.self).resourcePath!) + + let classifier = Classifier(path: Bundle(for: ViewController.self).resourcePath!) let (images, labels) = downloadTestData() - let xArray: [[Float]] = [UInt8](UnsafeBufferPointer(start: UnsafePointer(images.bytes + 16), count: 28 * 28 * 10000)).map { Float($0) / 255.0 }.grouped(28 * 28) - let yArray: [Int] = [UInt8](UnsafeBufferPointer(start: UnsafePointer(labels.bytes + 8), count: 10000)).map { Int($0) } + print("start") + + let count = 10000 + + let xArray: [[Float]] = images.withUnsafeBytes { ptr in + [UInt8](UnsafeBufferPointer(start: UnsafePointer(ptr + 16), count: 28 * 28 * count)) + .map { Float($0) / 255.0 } + .grouped(28 * 28) + } + print("made xArray") + let yArray: [Int] = labels.withUnsafeBytes { ptr in + [UInt8](UnsafeBufferPointer(start: UnsafePointer(ptr + 8), count: count)) + .map { Int($0) } + } + print("made yArray") + + let accuracy = Float(zip(xArray, yArray) + .reduce(0) { $0 + (classifier.classify(Tensor(shape: [28, 28, 1], elements: $1.0)) == $1.1 ? 1 : 0) }) + / Float(yArray.count) - let accuracy = Float(zip(xArray, yArray).reduce(0) { $0 + (classifier.classify(Tensor(shape: [28, 28, 1], elements: $1.0)) == $1.1 ? 1 : 0) }) / Float(yArray.count) + print("accuracy: \(accuracy)") XCTAssertGreaterThan(accuracy, 0.99) } -} \ No newline at end of file +} diff --git a/MNIST/MNISTTests/Downloader.swift b/MNIST/MNISTTests/Downloader.swift index e685429..b2d9f7d 100644 --- a/MNIST/MNISTTests/Downloader.swift +++ b/MNIST/MNISTTests/Downloader.swift @@ -1,22 +1,26 @@ import Foundation -import zlib -func downloadTestData() -> (images: NSData, labels: NSData) { +func downloadTestData() -> (images: Data, labels: Data) { let baseUrl = "http://yann.lecun.com/exdb/mnist/" - let testImages = NSData(contentsOfURL: NSURL(string: baseUrl)!.URLByAppendingPathComponent("t10k-images-idx3-ubyte.gz"))! - let testLabels = NSData(contentsOfURL: NSURL(string: baseUrl)!.URLByAppendingPathComponent("t10k-labels-idx1-ubyte.gz"))! + var testImagesUrl = URL(string: baseUrl)!.appendingPathComponent("t10k-images-idx3-ubyte.gz") + var testLabelsUrl = URL(string: baseUrl)!.appendingPathComponent("t10k-labels-idx1-ubyte.gz") + + print("download: \(testImagesUrl)") + let testImages = try! Data(contentsOf: testImagesUrl) + print("download: \(testLabelsUrl)") + let testLabels = try! Data(contentsOf: testLabelsUrl) return (images: ungzip(testImages)!, labels: ungzip(testLabels)!) } -private func ungzip(source: NSData) -> NSData? { - guard source.length > 0 else { +private func ungzip(_ source: Data) -> Data? { + guard source.count > 0 else { return nil } - var stream: z_stream = z_stream.init(next_in: UnsafeMutablePointer(source.bytes), avail_in: uint(source.length), total_in: 0, next_out: nil, avail_out: 0, total_out: 0, msg: nil, state: nil, zalloc: nil, zfree: nil, opaque: nil, data_type: 0, adler: 0, reserved: 0) - guard inflateInit2_(&stream, MAX_WBITS + 32, ZLIB_VERSION, Int32(sizeof(z_stream))) == Z_OK else { + var stream: z_stream = z_stream.init(next_in: UnsafeMutablePointer(mutating: (source as NSData).bytes.bindMemory(to: Bytef.self, capacity: source.count)), avail_in: uint(source.count), total_in: 0, next_out: nil, avail_out: 0, total_out: 0, msg: nil, state: nil, zalloc: nil, zfree: nil, opaque: nil, data_type: 0, adler: 0, reserved: 0) + guard inflateInit2_(&stream, MAX_WBITS + 32, ZLIB_VERSION, Int32(MemoryLayout.size)) == Z_OK else { return nil } @@ -24,17 +28,17 @@ private func ungzip(source: NSData) -> NSData? { while stream.avail_out == 0 { let bufferSize = 0x10000 - let buffer: UnsafeMutablePointer = UnsafeMutablePointer.alloc(bufferSize) + let buffer: UnsafeMutablePointer = UnsafeMutablePointer.allocate(capacity: bufferSize) stream.next_out = buffer - stream.avail_out = uint(sizeofValue(buffer)) + stream.avail_out = uint(MemoryLayout.size(ofValue: buffer)) inflate(&stream, Z_FINISH) - let length: size_t = sizeofValue(buffer) - Int(stream.avail_out) + let length: size_t = MemoryLayout.size(ofValue: buffer) - Int(stream.avail_out) if length > 0 { - data.appendBytes(buffer, length: length) + data.append(buffer, length: length) } - buffer.dealloc(bufferSize) + buffer.deallocate(capacity: bufferSize) } inflateEnd(&stream) - return NSData(data: data) -} \ No newline at end of file + return (NSData(data: data as Data) as Data) +} diff --git a/MNIST/MNISTTests/DownloaderTest.swift b/MNIST/MNISTTests/DownloaderTest.swift index 8cbfa69..e6b69ca 100644 --- a/MNIST/MNISTTests/DownloaderTest.swift +++ b/MNIST/MNISTTests/DownloaderTest.swift @@ -4,7 +4,7 @@ class Downloader: XCTestCase { func testDownloadTestData() { let testData = downloadTestData() - XCTAssertEqual(testData.images.length, 7840016) + XCTAssertEqual(testData.images.count, 7840016) XCTAssertEqual(testData.images.sha1, "65e11ec1fd220343092a5070b58418b5c2644e26") } } diff --git a/MNIST/MNISTTests/Header.h b/MNIST/MNISTTests/Header.h index 0ff2766..5269eae 100644 --- a/MNIST/MNISTTests/Header.h +++ b/MNIST/MNISTTests/Header.h @@ -9,5 +9,4 @@ #ifndef Header_h #define Header_h - #endif /* Header_h */ diff --git a/MNIST/MNISTTests/MNISTTests-Bridging-Header.h b/MNIST/MNISTTests/MNISTTests-Bridging-Header.h index 5b7bcec..e1b7713 100644 --- a/MNIST/MNISTTests/MNISTTests-Bridging-Header.h +++ b/MNIST/MNISTTests/MNISTTests-Bridging-Header.h @@ -2,5 +2,7 @@ #define MNISTTests_Bridging_Header_h #import +#import "zlib.h" + #endif /* MNISTTests_Bridging_Header_h */ diff --git a/MNIST/MNISTTests/SHA1.swift b/MNIST/MNISTTests/SHA1.swift index c50104f..5b173cb 100644 --- a/MNIST/MNISTTests/SHA1.swift +++ b/MNIST/MNISTTests/SHA1.swift @@ -1,11 +1,11 @@ import Foundation -extension NSData { +extension Data { var sha1: String { let data = self - var digest = [UInt8](count:Int(CC_SHA1_DIGEST_LENGTH), repeatedValue: 0) - CC_SHA1(data.bytes, CC_LONG(data.length), &digest) + var digest = [UInt8](repeating: 0, count: Int(CC_SHA1_DIGEST_LENGTH)) + CC_SHA1((data as NSData).bytes, CC_LONG(data.count), &digest) let hexBytes = digest.map { String(format: "%02hhx", $0) } - return hexBytes.joinWithSeparator("") + return hexBytes.joined(separator: "") } } diff --git a/MNIST/MNISTUITests/Info.plist b/MNIST/MNISTUITests/Info.plist deleted file mode 100644 index 6c6c23c..0000000 --- a/MNIST/MNISTUITests/Info.plist +++ /dev/null @@ -1,22 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - BNDL - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - - diff --git a/MNIST/MNISTUITests/MNISTUITests.swift b/MNIST/MNISTUITests/MNISTUITests.swift deleted file mode 100644 index 325de47..0000000 --- a/MNIST/MNISTUITests/MNISTUITests.swift +++ /dev/null @@ -1,36 +0,0 @@ -// -// MNISTUITests.swift -// MNISTUITests -// -// Created by Araki Takehiro on 2016/09/27. -// Copyright © 2016年 Araki Takehiro. All rights reserved. -// - -import XCTest - -class MNISTUITests: XCTestCase { - - override func setUp() { - super.setUp() - - // Put setup code here. This method is called before the invocation of each test method in the class. - - // In UI tests it is usually best to stop immediately when a failure occurs. - continueAfterFailure = false - // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. - XCUIApplication().launch() - - // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. - } - - override func tearDown() { - // Put teardown code here. This method is called after the invocation of each test method in the class. - super.tearDown() - } - - func testExample() { - // Use recording to get started writing UI tests. - // Use XCTAssert and related functions to verify your tests produce the correct results. - } - -} diff --git a/zlib/include.h b/zlib/include.h deleted file mode 100755 index 4470a1f..0000000 --- a/zlib/include.h +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/zlib/module.modulemap b/zlib/module.modulemap deleted file mode 100755 index ef90391..0000000 --- a/zlib/module.modulemap +++ /dev/null @@ -1,4 +0,0 @@ -module zlib [system] { - header "include.h" - export * -} From 3a610b0abda5d4c249778b2d1b1290b4e3370f5a Mon Sep 17 00:00:00 2001 From: araki Date: Tue, 27 Sep 2016 13:52:21 +0900 Subject: [PATCH 05/26] Update podspec. --- TensorSwift.podspec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TensorSwift.podspec b/TensorSwift.podspec index 99b1d6a..08627f3 100644 --- a/TensorSwift.podspec +++ b/TensorSwift.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "TensorSwift" - s.version = "0.1.0" + s.version = "0.2.0" s.summary = "TensorSwift is a lightweight library to calculate tensors, which has similar APIs to TensorFlow's." s.homepage = "https://github.com/qoncept/TensorSwift" s.license = { :type => "MIT", :file => "LICENSE" } @@ -11,5 +11,5 @@ Pod::Spec.new do |s| # s.watchos.deployment_target = "2.0" # s.tvos.deployment_target = "9.0" s.source = { :git => "https://github.com/qoncept/TensorSwift.git", :tag => "#{s.version}" } - s.source_files = "TensorSwift/*.swift" + s.source_files = "Sources/*.swift" end From 605ed08bf15140413022821f3752649faf0aee5b Mon Sep 17 00:00:00 2001 From: araki Date: Tue, 27 Sep 2016 14:27:52 +0900 Subject: [PATCH 06/26] Change fileprivate -> private. --- MNIST/MNIST/CanvasView.swift | 2 +- MNIST/MNIST/ViewController.swift | 6 +++--- TensorSwift.xcodeproj/project.pbxproj | 4 ---- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/MNIST/MNIST/CanvasView.swift b/MNIST/MNIST/CanvasView.swift index a4e45be..b3040c0 100644 --- a/MNIST/MNIST/CanvasView.swift +++ b/MNIST/MNIST/CanvasView.swift @@ -1,7 +1,7 @@ import UIKit class CanvasView: UIView { - fileprivate(set) var canvas: Canvas + private(set) var canvas: Canvas required init?(coder: NSCoder) { canvas = Canvas() diff --git a/MNIST/MNIST/ViewController.swift b/MNIST/MNIST/ViewController.swift index 0b65b8d..dc63422 100644 --- a/MNIST/MNIST/ViewController.swift +++ b/MNIST/MNIST/ViewController.swift @@ -2,10 +2,10 @@ import UIKit import TensorSwift class ViewController: UIViewController { - @IBOutlet fileprivate var canvasView: CanvasView! + @IBOutlet private var canvasView: CanvasView! - fileprivate let inputSize = 28 - fileprivate let classifier = Classifier(path: Bundle.main.resourcePath!) + private let inputSize = 28 + private let classifier = Classifier(path: Bundle.main.resourcePath!) @IBAction func onPressClassifyButton(_ sender: UIButton) { let input: Tensor diff --git a/TensorSwift.xcodeproj/project.pbxproj b/TensorSwift.xcodeproj/project.pbxproj index 1d54e5c..288f9cb 100644 --- a/TensorSwift.xcodeproj/project.pbxproj +++ b/TensorSwift.xcodeproj/project.pbxproj @@ -44,14 +44,12 @@ __PBXFileRef_Sources/TensorNN.swift /* TensorNN.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TensorNN.swift; sourceTree = ""; }; __PBXFileRef_Sources/Utils.swift /* Utils.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Utils.swift; sourceTree = ""; }; __PBXFileRef_TensorSwift.xcodeproj/Configs/Project.xcconfig /* TensorSwift.xcodeproj/Configs/Project.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = TensorSwift.xcodeproj/Configs/Project.xcconfig; sourceTree = ""; }; - __PBXFileRef_TensorSwiftTests /* TensorSwiftTests */ = {isa = PBXFileReference; lastKnownFileType = folder; path = TensorSwiftTests; sourceTree = ""; }; __PBXFileRef_Tests/TensorSwiftTests/CalculationPerformanceTests.swift /* CalculationPerformanceTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CalculationPerformanceTests.swift; sourceTree = ""; }; __PBXFileRef_Tests/TensorSwiftTests/DimensionTest.swift /* DimensionTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DimensionTest.swift; sourceTree = ""; }; __PBXFileRef_Tests/TensorSwiftTests/PowerTest.swift /* PowerTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PowerTest.swift; sourceTree = ""; }; __PBXFileRef_Tests/TensorSwiftTests/TensorNNTest.swift /* TensorNNTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TensorNNTest.swift; sourceTree = ""; }; __PBXFileRef_Tests/TensorSwiftTests/TensorSwiftSample.swift /* TensorSwiftSample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TensorSwiftSample.swift; sourceTree = ""; }; __PBXFileRef_Tests/TensorSwiftTests/TensorTest.swift /* TensorTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TensorTest.swift; sourceTree = ""; }; - __PBXFileRef_zlib /* zlib */ = {isa = PBXFileReference; lastKnownFileType = folder; path = zlib; sourceTree = ""; }; "_____Product_TensorSwift" /* TensorSwift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = TensorSwift.framework; sourceTree = BUILT_PRODUCTS_DIR; }; "_____Product_TensorSwiftTests" /* TensorSwiftTests.xctest */ = {isa = PBXFileReference; lastKnownFileType = file; path = TensorSwiftTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ @@ -90,8 +88,6 @@ "_____Configs_" /* Configs */, "_____Sources_" /* Sources */, __PBXFileRef_Resources /* Resources */, - __PBXFileRef_TensorSwiftTests /* TensorSwiftTests */, - __PBXFileRef_zlib /* zlib */, "_______Tests_" /* Tests */, "____Products_" /* Products */, ); From 4c94dc81495e98045be1e50659191eeca4ae09b3 Mon Sep 17 00:00:00 2001 From: araki Date: Wed, 28 Sep 2016 17:40:44 +0900 Subject: [PATCH 07/26] Rename test files, Add TensorSwiftTests.swift. --- TensorSwift.xcodeproj/project.pbxproj | 61 +++++++++++-------- ...mensionTest.swift => DimensionTests.swift} | 0 .../{PowerTest.swift => PowerTests.swift} | 0 ...TensorNNTest.swift => TensorNNTests.swift} | 0 Tests/TensorSwiftTests/TensorSwiftTests.swift | 23 +++++++ .../{TensorTest.swift => TensorTests.swift} | 0 6 files changed, 59 insertions(+), 25 deletions(-) rename Tests/TensorSwiftTests/{DimensionTest.swift => DimensionTests.swift} (100%) rename Tests/TensorSwiftTests/{PowerTest.swift => PowerTests.swift} (100%) rename Tests/TensorSwiftTests/{TensorNNTest.swift => TensorNNTests.swift} (100%) create mode 100644 Tests/TensorSwiftTests/TensorSwiftTests.swift rename Tests/TensorSwiftTests/{TensorTest.swift => TensorTests.swift} (100%) diff --git a/TensorSwift.xcodeproj/project.pbxproj b/TensorSwift.xcodeproj/project.pbxproj index 288f9cb..2e1ee4b 100644 --- a/TensorSwift.xcodeproj/project.pbxproj +++ b/TensorSwift.xcodeproj/project.pbxproj @@ -7,6 +7,13 @@ objects = { /* Begin PBXBuildFile section */ + A7DF6F881D9BB9240097CEB7 /* CalculationPerformanceTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7DF6F811D9BB9240097CEB7 /* CalculationPerformanceTests.swift */; }; + A7DF6F891D9BB9240097CEB7 /* DimensionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7DF6F821D9BB9240097CEB7 /* DimensionTests.swift */; }; + A7DF6F8A1D9BB9240097CEB7 /* PowerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7DF6F841D9BB9240097CEB7 /* PowerTests.swift */; }; + A7DF6F8B1D9BB9240097CEB7 /* TensorNNTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7DF6F851D9BB9240097CEB7 /* TensorNNTests.swift */; }; + A7DF6F8C1D9BB9240097CEB7 /* TensorSwiftSample.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7DF6F861D9BB9240097CEB7 /* TensorSwiftSample.swift */; }; + A7DF6F8D1D9BB9240097CEB7 /* TensorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7DF6F871D9BB9240097CEB7 /* TensorTests.swift */; }; + A7DF6F8F1D9BB9660097CEB7 /* TensorSwiftTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7DF6F8E1D9BB9660097CEB7 /* TensorSwiftTests.swift */; }; _LinkFileRef_TensorSwift_via_TensorSwiftTests /* TensorSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = "_____Product_TensorSwift" /* TensorSwift.framework */; }; __src_cc_ref_Sources/Dimension.swift /* Dimension.swift in Sources */ = {isa = PBXBuildFile; fileRef = __PBXFileRef_Sources/Dimension.swift /* Dimension.swift */; }; __src_cc_ref_Sources/Operators.swift /* Operators.swift in Sources */ = {isa = PBXBuildFile; fileRef = __PBXFileRef_Sources/Operators.swift /* Operators.swift */; }; @@ -15,12 +22,6 @@ __src_cc_ref_Sources/TensorMath.swift /* TensorMath.swift in Sources */ = {isa = PBXBuildFile; fileRef = __PBXFileRef_Sources/TensorMath.swift /* TensorMath.swift */; }; __src_cc_ref_Sources/TensorNN.swift /* TensorNN.swift in Sources */ = {isa = PBXBuildFile; fileRef = __PBXFileRef_Sources/TensorNN.swift /* TensorNN.swift */; }; __src_cc_ref_Sources/Utils.swift /* Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = __PBXFileRef_Sources/Utils.swift /* Utils.swift */; }; - __src_cc_ref_Tests/TensorSwiftTests/CalculationPerformanceTests.swift /* CalculationPerformanceTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = __PBXFileRef_Tests/TensorSwiftTests/CalculationPerformanceTests.swift /* CalculationPerformanceTests.swift */; }; - __src_cc_ref_Tests/TensorSwiftTests/DimensionTest.swift /* DimensionTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = __PBXFileRef_Tests/TensorSwiftTests/DimensionTest.swift /* DimensionTest.swift */; }; - __src_cc_ref_Tests/TensorSwiftTests/PowerTest.swift /* PowerTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = __PBXFileRef_Tests/TensorSwiftTests/PowerTest.swift /* PowerTest.swift */; }; - __src_cc_ref_Tests/TensorSwiftTests/TensorNNTest.swift /* TensorNNTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = __PBXFileRef_Tests/TensorSwiftTests/TensorNNTest.swift /* TensorNNTest.swift */; }; - __src_cc_ref_Tests/TensorSwiftTests/TensorSwiftSample.swift /* TensorSwiftSample.swift in Sources */ = {isa = PBXBuildFile; fileRef = __PBXFileRef_Tests/TensorSwiftTests/TensorSwiftSample.swift /* TensorSwiftSample.swift */; }; - __src_cc_ref_Tests/TensorSwiftTests/TensorTest.swift /* TensorTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = __PBXFileRef_Tests/TensorSwiftTests/TensorTest.swift /* TensorTest.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -34,6 +35,13 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + A7DF6F811D9BB9240097CEB7 /* CalculationPerformanceTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CalculationPerformanceTests.swift; sourceTree = ""; }; + A7DF6F821D9BB9240097CEB7 /* DimensionTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DimensionTests.swift; sourceTree = ""; }; + A7DF6F841D9BB9240097CEB7 /* PowerTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PowerTests.swift; sourceTree = ""; }; + A7DF6F851D9BB9240097CEB7 /* TensorNNTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TensorNNTests.swift; sourceTree = ""; }; + A7DF6F861D9BB9240097CEB7 /* TensorSwiftSample.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TensorSwiftSample.swift; sourceTree = ""; }; + A7DF6F871D9BB9240097CEB7 /* TensorTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TensorTests.swift; sourceTree = ""; }; + A7DF6F8E1D9BB9660097CEB7 /* TensorSwiftTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TensorSwiftTests.swift; sourceTree = ""; }; __PBXFileRef_Package.swift /* Package.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Package.swift; sourceTree = ""; }; __PBXFileRef_Resources /* Resources */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Resources; sourceTree = ""; }; __PBXFileRef_Sources/Dimension.swift /* Dimension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Dimension.swift; sourceTree = ""; }; @@ -44,14 +52,8 @@ __PBXFileRef_Sources/TensorNN.swift /* TensorNN.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TensorNN.swift; sourceTree = ""; }; __PBXFileRef_Sources/Utils.swift /* Utils.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Utils.swift; sourceTree = ""; }; __PBXFileRef_TensorSwift.xcodeproj/Configs/Project.xcconfig /* TensorSwift.xcodeproj/Configs/Project.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = TensorSwift.xcodeproj/Configs/Project.xcconfig; sourceTree = ""; }; - __PBXFileRef_Tests/TensorSwiftTests/CalculationPerformanceTests.swift /* CalculationPerformanceTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CalculationPerformanceTests.swift; sourceTree = ""; }; - __PBXFileRef_Tests/TensorSwiftTests/DimensionTest.swift /* DimensionTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DimensionTest.swift; sourceTree = ""; }; - __PBXFileRef_Tests/TensorSwiftTests/PowerTest.swift /* PowerTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PowerTest.swift; sourceTree = ""; }; - __PBXFileRef_Tests/TensorSwiftTests/TensorNNTest.swift /* TensorNNTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TensorNNTest.swift; sourceTree = ""; }; - __PBXFileRef_Tests/TensorSwiftTests/TensorSwiftSample.swift /* TensorSwiftSample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TensorSwiftSample.swift; sourceTree = ""; }; - __PBXFileRef_Tests/TensorSwiftTests/TensorTest.swift /* TensorTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TensorTest.swift; sourceTree = ""; }; "_____Product_TensorSwift" /* TensorSwift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = TensorSwift.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - "_____Product_TensorSwiftTests" /* TensorSwiftTests.xctest */ = {isa = PBXFileReference; lastKnownFileType = file; path = TensorSwiftTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + "_____Product_TensorSwiftTests" /* TensorSwiftTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; path = TensorSwiftTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -136,12 +138,13 @@ "_______Group_TensorSwiftTests" /* TensorSwiftTests */ = { isa = PBXGroup; children = ( - __PBXFileRef_Tests/TensorSwiftTests/CalculationPerformanceTests.swift /* CalculationPerformanceTests.swift */, - __PBXFileRef_Tests/TensorSwiftTests/DimensionTest.swift /* DimensionTest.swift */, - __PBXFileRef_Tests/TensorSwiftTests/PowerTest.swift /* PowerTest.swift */, - __PBXFileRef_Tests/TensorSwiftTests/TensorNNTest.swift /* TensorNNTest.swift */, - __PBXFileRef_Tests/TensorSwiftTests/TensorSwiftSample.swift /* TensorSwiftSample.swift */, - __PBXFileRef_Tests/TensorSwiftTests/TensorTest.swift /* TensorTest.swift */, + A7DF6F8E1D9BB9660097CEB7 /* TensorSwiftTests.swift */, + A7DF6F811D9BB9240097CEB7 /* CalculationPerformanceTests.swift */, + A7DF6F821D9BB9240097CEB7 /* DimensionTests.swift */, + A7DF6F841D9BB9240097CEB7 /* PowerTests.swift */, + A7DF6F851D9BB9240097CEB7 /* TensorNNTests.swift */, + A7DF6F861D9BB9240097CEB7 /* TensorSwiftSample.swift */, + A7DF6F871D9BB9240097CEB7 /* TensorTests.swift */, ); name = TensorSwiftTests; path = Tests/TensorSwiftTests; @@ -198,6 +201,11 @@ isa = PBXProject; attributes = { LastUpgradeCheck = 9999; + TargetAttributes = { + "______Target_TensorSwiftTests" = { + LastSwiftMigration = 0800; + }; + }; }; buildConfigurationList = "___RootConfs_" /* Build configuration list for PBXProject "TensorSwift" */; compatibilityVersion = "Xcode 3.2"; @@ -222,11 +230,17 @@ isa = PBXSourcesBuildPhase; buildActionMask = 0; files = ( + A7DF6F891D9BB9240097CEB7 /* DimensionTests.swift in Sources */, + A7DF6F8A1D9BB9240097CEB7 /* PowerTests.swift in Sources */, + A7DF6F881D9BB9240097CEB7 /* CalculationPerformanceTests.swift in Sources */, __src_cc_ref_Sources/Dimension.swift /* Dimension.swift in Sources */, + A7DF6F8C1D9BB9240097CEB7 /* TensorSwiftSample.swift in Sources */, __src_cc_ref_Sources/Operators.swift /* Operators.swift in Sources */, + A7DF6F8B1D9BB9240097CEB7 /* TensorNNTests.swift in Sources */, __src_cc_ref_Sources/Shape.swift /* Shape.swift in Sources */, __src_cc_ref_Sources/Tensor.swift /* Tensor.swift in Sources */, __src_cc_ref_Sources/TensorMath.swift /* TensorMath.swift in Sources */, + A7DF6F8D1D9BB9240097CEB7 /* TensorTests.swift in Sources */, __src_cc_ref_Sources/TensorNN.swift /* TensorNN.swift in Sources */, __src_cc_ref_Sources/Utils.swift /* Utils.swift in Sources */, ); @@ -236,12 +250,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 0; files = ( - __src_cc_ref_Tests/TensorSwiftTests/CalculationPerformanceTests.swift /* CalculationPerformanceTests.swift in Sources */, - __src_cc_ref_Tests/TensorSwiftTests/DimensionTest.swift /* DimensionTest.swift in Sources */, - __src_cc_ref_Tests/TensorSwiftTests/PowerTest.swift /* PowerTest.swift in Sources */, - __src_cc_ref_Tests/TensorSwiftTests/TensorNNTest.swift /* TensorNNTest.swift in Sources */, - __src_cc_ref_Tests/TensorSwiftTests/TensorSwiftSample.swift /* TensorSwiftSample.swift in Sources */, - __src_cc_ref_Tests/TensorSwiftTests/TensorTest.swift /* TensorTest.swift in Sources */, + A7DF6F8F1D9BB9660097CEB7 /* TensorSwiftTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -276,6 +285,7 @@ _ReleaseConf_TensorSwiftTests /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_MODULES = YES; EMBEDDED_CONTENT_CONTAINS_SWIFT = YES; FRAMEWORK_SEARCH_PATHS = "$(PLATFORM_DIR)/Developer/Library/Frameworks"; INFOPLIST_FILE = TensorSwift.xcodeproj/TensorSwiftTests_Info.plist; @@ -307,6 +317,7 @@ "___DebugConf_TensorSwiftTests" /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_MODULES = YES; EMBEDDED_CONTENT_CONTAINS_SWIFT = YES; FRAMEWORK_SEARCH_PATHS = "$(PLATFORM_DIR)/Developer/Library/Frameworks"; INFOPLIST_FILE = TensorSwift.xcodeproj/TensorSwiftTests_Info.plist; diff --git a/Tests/TensorSwiftTests/DimensionTest.swift b/Tests/TensorSwiftTests/DimensionTests.swift similarity index 100% rename from Tests/TensorSwiftTests/DimensionTest.swift rename to Tests/TensorSwiftTests/DimensionTests.swift diff --git a/Tests/TensorSwiftTests/PowerTest.swift b/Tests/TensorSwiftTests/PowerTests.swift similarity index 100% rename from Tests/TensorSwiftTests/PowerTest.swift rename to Tests/TensorSwiftTests/PowerTests.swift diff --git a/Tests/TensorSwiftTests/TensorNNTest.swift b/Tests/TensorSwiftTests/TensorNNTests.swift similarity index 100% rename from Tests/TensorSwiftTests/TensorNNTest.swift rename to Tests/TensorSwiftTests/TensorNNTests.swift diff --git a/Tests/TensorSwiftTests/TensorSwiftTests.swift b/Tests/TensorSwiftTests/TensorSwiftTests.swift new file mode 100644 index 0000000..5a4c89f --- /dev/null +++ b/Tests/TensorSwiftTests/TensorSwiftTests.swift @@ -0,0 +1,23 @@ +// +// TensorSwiftTests.swift +// TensorSwift +// +// Created by Araki Takehiro on 2016/09/28. +// +// + +import XCTest + +class TensorSwiftTests: XCTestCase { + + override func setUp() { + super.setUp() + // Put setup code here. This method is called before the invocation of each test method in the class. + } + + override func tearDown() { + // Put teardown code here. This method is called after the invocation of each test method in the class. + super.tearDown() + } + +} diff --git a/Tests/TensorSwiftTests/TensorTest.swift b/Tests/TensorSwiftTests/TensorTests.swift similarity index 100% rename from Tests/TensorSwiftTests/TensorTest.swift rename to Tests/TensorSwiftTests/TensorTests.swift From b2817bc4f15a210deb5dac0bce1f6c184dabeaa2 Mon Sep 17 00:00:00 2001 From: araki Date: Wed, 28 Sep 2016 17:44:15 +0900 Subject: [PATCH 08/26] Add tests in LinuxMain.swift. --- Tests/LinuxMain.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Tests/LinuxMain.swift b/Tests/LinuxMain.swift index 98c9f8f..ea0b66e 100644 --- a/Tests/LinuxMain.swift +++ b/Tests/LinuxMain.swift @@ -3,4 +3,10 @@ import XCTest XCTMain([ testCase(TensorSwiftTests.allTests), + testCase(DimensionTests.allTests), + testCase(PowerTests.allTests), + testCase(TensorTests.allTests), + testCase(TensorNNTests.allTests), + testCase(CalculationPerformanceTests.allTests), + testCase(TensorSwiftSample.allTests), ]) From cb76b614500ad073e8affa6eb15a65ec4f1edb3d Mon Sep 17 00:00:00 2001 From: araki Date: Wed, 28 Sep 2016 17:57:09 +0900 Subject: [PATCH 09/26] Update README.md. --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index bec0dab..f5de083 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,12 @@ pod 'TensorSwift', '~> 0.1' github "qoncept/TensorSwift" ~> 0.1 ``` +### Swift Package Manager +``` +.Package(url: "git@github.com:qoncept/TensorSwift.git", + Version(0, 2, 0, prereleaseIdentifiers: ["beta"])), +``` + ## License [The MIT License](LICENSE) From 38069e41eb9601b3d5d7d2908e94536bd88b8292 Mon Sep 17 00:00:00 2001 From: araki Date: Thu, 29 Sep 2016 13:41:25 +0900 Subject: [PATCH 10/26] Add allTests for all test classes, rename test classes --- MNIST/MNIST.xcodeproj/project.pbxproj | 4 +++- .../CalculationPerformanceTests.swift | 11 ++++++++++- Tests/TensorSwiftTests/DimensionTests.swift | 11 ++++++++++- Tests/TensorSwiftTests/PowerTests.swift | 8 +++++++- Tests/TensorSwiftTests/TensorNNTests.swift | 11 ++++++++++- Tests/TensorSwiftTests/TensorSwiftSample.swift | 8 +++++++- Tests/TensorSwiftTests/TensorSwiftTests.swift | 5 +++++ Tests/TensorSwiftTests/TensorTests.swift | 14 +++++++++++++- 8 files changed, 65 insertions(+), 7 deletions(-) diff --git a/MNIST/MNIST.xcodeproj/project.pbxproj b/MNIST/MNIST.xcodeproj/project.pbxproj index 6af9478..a8a592c 100644 --- a/MNIST/MNIST.xcodeproj/project.pbxproj +++ b/MNIST/MNIST.xcodeproj/project.pbxproj @@ -323,7 +323,7 @@ }; A7DF6EF91D9A1B5B0097CEB7 /* TensorSwiftTests.xctest */ = { isa = PBXReferenceProxy; - fileType = file; + fileType = wrapper.cfbundle; path = TensorSwiftTests.xctest; remoteRef = A7DF6EF81D9A1B5B0097CEB7 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; @@ -602,6 +602,7 @@ A7DF6EEA1D9A1B4A0097CEB7 /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; A7DF6EEB1D9A1B4A0097CEB7 /* Build configuration list for PBXNativeTarget "MNISTTests" */ = { isa = XCConfigurationList; @@ -610,6 +611,7 @@ A7DF6EED1D9A1B4A0097CEB7 /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; diff --git a/Tests/TensorSwiftTests/CalculationPerformanceTests.swift b/Tests/TensorSwiftTests/CalculationPerformanceTests.swift index f37bc08..53e7c18 100644 --- a/Tests/TensorSwiftTests/CalculationPerformanceTests.swift +++ b/Tests/TensorSwiftTests/CalculationPerformanceTests.swift @@ -11,7 +11,7 @@ private func getTensor1x1000() -> Tensor { return Tensor(shape: [1, 1000], elements: elements) } -class CalculationPerformanceTest : XCTestCase { +class CalculationPerformanceTests : XCTestCase { func testElementAccess(){ let W = getTensor1000x1000() measure{ @@ -59,4 +59,13 @@ class CalculationPerformanceTest : XCTestCase { let _ = Tensor(shape: [1,1000], elements: elements) } } + + static var allTests : [(String, (CalculationPerformanceTests) -> () throws -> Void)] { + return [ + ("testElementAccess", testElementAccess), + ("testElementAccessRaw", testElementAccessRaw), + ("testElementMultiplication", testMultiplication), + ("testElementMultiplicationRaw", testMultiplicationRaw), + ] + } } diff --git a/Tests/TensorSwiftTests/DimensionTests.swift b/Tests/TensorSwiftTests/DimensionTests.swift index de99f99..152e23c 100644 --- a/Tests/TensorSwiftTests/DimensionTests.swift +++ b/Tests/TensorSwiftTests/DimensionTests.swift @@ -1,7 +1,7 @@ import XCTest @testable import TensorSwift -class DimensionTest: XCTestCase { +class DimensionTests: XCTestCase { func testAdd() { do { let a = Dimension(2) @@ -34,4 +34,13 @@ class DimensionTest: XCTestCase { XCTAssertEqual(a / b, 3) } } + + static var allTests : [(String, (DimensionTests) -> () throws -> Void)] { + return [ + ("testAdd", testAdd), + ("testSub", testSub), + ("testMul", testMul), + ("testDiv", testDiv), + ] + } } diff --git a/Tests/TensorSwiftTests/PowerTests.swift b/Tests/TensorSwiftTests/PowerTests.swift index 2e01bef..a709d0e 100644 --- a/Tests/TensorSwiftTests/PowerTests.swift +++ b/Tests/TensorSwiftTests/PowerTests.swift @@ -1,7 +1,7 @@ import XCTest @testable import TensorSwift -class PowerTest: XCTestCase { +class PowerTests: XCTestCase { func testScalar() { let tensor = Tensor(shape: [2, 2], elements: [1, 2, 3, 4]) @@ -23,4 +23,10 @@ class PowerTest: XCTestCase { XCTAssertEqual(tensor ** tensor2 ** tensor, Tensor(shape: [2, 2], elements: [1, 16, pow(3, 8), pow(4, 16)])) } + static var allTests : [(String, (PowerTests) -> () throws -> Void)] { + return [ + ("testScalar", testScalar), + ("testMatrices", testMatrices), + ] + } } diff --git a/Tests/TensorSwiftTests/TensorNNTests.swift b/Tests/TensorSwiftTests/TensorNNTests.swift index c505e34..658ec2c 100644 --- a/Tests/TensorSwiftTests/TensorNNTests.swift +++ b/Tests/TensorSwiftTests/TensorNNTests.swift @@ -1,7 +1,7 @@ import XCTest @testable import TensorSwift -class TensorNNTest: XCTestCase { +class TensorNNTests: XCTestCase { func testMaxPool() { do { let a = Tensor(shape: [2,3,1], elements: [0,1,2,3,4,5]) @@ -77,4 +77,13 @@ class TensorNNTest: XCTestCase { image.conv2d(filter: filter, strides: [1,1,1]) } } + + static var allTests : [(String, (TensorNNTests) -> () throws -> Void)] { + return [ + ("testMaxPool", testMaxPool), + ("testConv2d", testConv2d), + ("testMaxPoolPerformance", testMaxPoolPerformance), + ("testConv2dPerformance", testConv2dPerformance), + ] + } } diff --git a/Tests/TensorSwiftTests/TensorSwiftSample.swift b/Tests/TensorSwiftTests/TensorSwiftSample.swift index 7389056..616ddfc 100644 --- a/Tests/TensorSwiftTests/TensorSwiftSample.swift +++ b/Tests/TensorSwiftTests/TensorSwiftSample.swift @@ -20,4 +20,10 @@ class TensorSwiftSample: XCTestCase { XCTAssertEqual(zeros, Tensor(shape: [2, 3, 4], elements: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])) XCTAssertEqual(ones, Tensor(shape: [2, 3, 4], elements: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1])) } -} \ No newline at end of file + + static var allTests : [(String, (TensorSwiftSample) -> () throws -> Void)] { + return [ + ("testSample", testSample), + ] + } +} diff --git a/Tests/TensorSwiftTests/TensorSwiftTests.swift b/Tests/TensorSwiftTests/TensorSwiftTests.swift index 5a4c89f..581760f 100644 --- a/Tests/TensorSwiftTests/TensorSwiftTests.swift +++ b/Tests/TensorSwiftTests/TensorSwiftTests.swift @@ -20,4 +20,9 @@ class TensorSwiftTests: XCTestCase { super.tearDown() } + static var allTests : [(String, (TensorSwiftTests) -> () throws -> Void)] { + return [ + + ] + } } diff --git a/Tests/TensorSwiftTests/TensorTests.swift b/Tests/TensorSwiftTests/TensorTests.swift index 2a1e357..3cbe415 100644 --- a/Tests/TensorSwiftTests/TensorTests.swift +++ b/Tests/TensorSwiftTests/TensorTests.swift @@ -1,7 +1,7 @@ import XCTest @testable import TensorSwift -class TensorTest: XCTestCase { +class TensorTests: XCTestCase { func testIndex() { do { let a = Tensor(shape: []) @@ -152,4 +152,16 @@ class TensorTest: XCTestCase { a.matmul(b) } } + + static var allTests : [(String, (TensorTests) -> () throws -> Void)] { + return [ + ("testIndex", testIndex), + ("testAdd", testAdd), + ("testSub", testSub), + ("testMul", testMul), + ("testDiv", testDiv), + ("testMatmul", testMatmul), + ("testMatmulPerformance", testMatmulPerformance), + ] + } } From 75a82fc1d130947a09c3b938502193033e49f705 Mon Sep 17 00:00:00 2001 From: araki Date: Sat, 1 Oct 2016 10:35:38 +0900 Subject: [PATCH 11/26] Modify author in podspec --- TensorSwift.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TensorSwift.podspec b/TensorSwift.podspec index 08627f3..448bb8f 100644 --- a/TensorSwift.podspec +++ b/TensorSwift.podspec @@ -4,7 +4,7 @@ Pod::Spec.new do |s| s.summary = "TensorSwift is a lightweight library to calculate tensors, which has similar APIs to TensorFlow's." s.homepage = "https://github.com/qoncept/TensorSwift" s.license = { :type => "MIT", :file => "LICENSE" } - s.authors = { "Yuta Koshizawa" => "koshizawa@qoncept.co.jp", "Araki Takehiro" => "araki@qoncept.co.jp" } + s.authors = { "Yuta Koshizawa" => "koshizawa@qoncept.co.jp", "Takehiro Araki" => "araki@qoncept.co.jp" } s.ios.deployment_target = "8.0" s.osx.deployment_target = "10.9" From f3422db294bc3c1ab75491195176b543e8080463 Mon Sep 17 00:00:00 2001 From: araki Date: Sat, 1 Oct 2016 11:06:58 +0900 Subject: [PATCH 12/26] Remove test files from Compile Sources --- TensorSwift.xcodeproj/project.pbxproj | 28 +++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/TensorSwift.xcodeproj/project.pbxproj b/TensorSwift.xcodeproj/project.pbxproj index 2e1ee4b..b3ab55d 100644 --- a/TensorSwift.xcodeproj/project.pbxproj +++ b/TensorSwift.xcodeproj/project.pbxproj @@ -7,13 +7,13 @@ objects = { /* Begin PBXBuildFile section */ - A7DF6F881D9BB9240097CEB7 /* CalculationPerformanceTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7DF6F811D9BB9240097CEB7 /* CalculationPerformanceTests.swift */; }; - A7DF6F891D9BB9240097CEB7 /* DimensionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7DF6F821D9BB9240097CEB7 /* DimensionTests.swift */; }; - A7DF6F8A1D9BB9240097CEB7 /* PowerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7DF6F841D9BB9240097CEB7 /* PowerTests.swift */; }; - A7DF6F8B1D9BB9240097CEB7 /* TensorNNTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7DF6F851D9BB9240097CEB7 /* TensorNNTests.swift */; }; - A7DF6F8C1D9BB9240097CEB7 /* TensorSwiftSample.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7DF6F861D9BB9240097CEB7 /* TensorSwiftSample.swift */; }; - A7DF6F8D1D9BB9240097CEB7 /* TensorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7DF6F871D9BB9240097CEB7 /* TensorTests.swift */; }; - A7DF6F8F1D9BB9660097CEB7 /* TensorSwiftTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7DF6F8E1D9BB9660097CEB7 /* TensorSwiftTests.swift */; }; + A7C046091D9F514600FAF16F /* TensorSwiftTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7DF6F8E1D9BB9660097CEB7 /* TensorSwiftTests.swift */; }; + A7C0460A1D9F514600FAF16F /* CalculationPerformanceTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7DF6F811D9BB9240097CEB7 /* CalculationPerformanceTests.swift */; }; + A7C0460B1D9F514600FAF16F /* DimensionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7DF6F821D9BB9240097CEB7 /* DimensionTests.swift */; }; + A7C0460C1D9F514600FAF16F /* PowerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7DF6F841D9BB9240097CEB7 /* PowerTests.swift */; }; + A7C0460D1D9F514600FAF16F /* TensorNNTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7DF6F851D9BB9240097CEB7 /* TensorNNTests.swift */; }; + A7C0460E1D9F514600FAF16F /* TensorSwiftSample.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7DF6F861D9BB9240097CEB7 /* TensorSwiftSample.swift */; }; + A7C0460F1D9F514600FAF16F /* TensorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7DF6F871D9BB9240097CEB7 /* TensorTests.swift */; }; _LinkFileRef_TensorSwift_via_TensorSwiftTests /* TensorSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = "_____Product_TensorSwift" /* TensorSwift.framework */; }; __src_cc_ref_Sources/Dimension.swift /* Dimension.swift in Sources */ = {isa = PBXBuildFile; fileRef = __PBXFileRef_Sources/Dimension.swift /* Dimension.swift */; }; __src_cc_ref_Sources/Operators.swift /* Operators.swift in Sources */ = {isa = PBXBuildFile; fileRef = __PBXFileRef_Sources/Operators.swift /* Operators.swift */; }; @@ -230,17 +230,11 @@ isa = PBXSourcesBuildPhase; buildActionMask = 0; files = ( - A7DF6F891D9BB9240097CEB7 /* DimensionTests.swift in Sources */, - A7DF6F8A1D9BB9240097CEB7 /* PowerTests.swift in Sources */, - A7DF6F881D9BB9240097CEB7 /* CalculationPerformanceTests.swift in Sources */, __src_cc_ref_Sources/Dimension.swift /* Dimension.swift in Sources */, - A7DF6F8C1D9BB9240097CEB7 /* TensorSwiftSample.swift in Sources */, __src_cc_ref_Sources/Operators.swift /* Operators.swift in Sources */, - A7DF6F8B1D9BB9240097CEB7 /* TensorNNTests.swift in Sources */, __src_cc_ref_Sources/Shape.swift /* Shape.swift in Sources */, __src_cc_ref_Sources/Tensor.swift /* Tensor.swift in Sources */, __src_cc_ref_Sources/TensorMath.swift /* TensorMath.swift in Sources */, - A7DF6F8D1D9BB9240097CEB7 /* TensorTests.swift in Sources */, __src_cc_ref_Sources/TensorNN.swift /* TensorNN.swift in Sources */, __src_cc_ref_Sources/Utils.swift /* Utils.swift in Sources */, ); @@ -250,7 +244,13 @@ isa = PBXSourcesBuildPhase; buildActionMask = 0; files = ( - A7DF6F8F1D9BB9660097CEB7 /* TensorSwiftTests.swift in Sources */, + A7C046091D9F514600FAF16F /* TensorSwiftTests.swift in Sources */, + A7C0460A1D9F514600FAF16F /* CalculationPerformanceTests.swift in Sources */, + A7C0460B1D9F514600FAF16F /* DimensionTests.swift in Sources */, + A7C0460C1D9F514600FAF16F /* PowerTests.swift in Sources */, + A7C0460D1D9F514600FAF16F /* TensorNNTests.swift in Sources */, + A7C0460E1D9F514600FAF16F /* TensorSwiftSample.swift in Sources */, + A7C0460F1D9F514600FAF16F /* TensorTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; From a20fd845e587589d427f172aaafbc569aec174ff Mon Sep 17 00:00:00 2001 From: araki Date: Sat, 1 Oct 2016 12:29:31 +0900 Subject: [PATCH 13/26] Move MNIST into TensorSwift.xcodeproj --- MNIST/{MNIST => }/AppDelegate.swift | 12 +- .../AppIcon.appiconset/Contents.json | 0 .../Base.lproj/LaunchScreen.storyboard | 0 MNIST/{MNIST => }/Base.lproj/Main.storyboard | 0 MNIST/{MNIST => }/Canvas.swift | 0 MNIST/{MNIST => }/CanvasView.swift | 0 MNIST/{MNIST => }/Classifier.swift | 0 MNIST/{MNIST => }/Info.plist | 22 +- MNIST/{MNIST => }/Line.swift | 0 MNIST/MNIST.xcodeproj/project.pbxproj | 619 --------------- .../contents.xcworkspacedata | 7 - MNIST/MNISTTests/Header.h | 12 - MNIST/MNISTTests/MNISTTest.swift | 5 - MNIST/{MNIST => }/Models/W_conv1 | Bin MNIST/{MNIST => }/Models/W_conv2 | Bin MNIST/{MNIST => }/Models/W_fc1 | Bin MNIST/{MNIST => }/Models/W_fc2 | Bin MNIST/{MNIST => }/Models/b_conv1 | 0 MNIST/{MNIST => }/Models/b_conv2 | 0 MNIST/{MNIST => }/Models/b_fc1 | Bin MNIST/{MNIST => }/Models/b_fc2 | 0 MNIST/{MNIST => }/String.swift | 0 MNIST/{MNIST => }/ViewController.swift | 0 {MNIST/MNISTTests => MNISTTests}/Array.swift | 0 .../ClassifierTest.swift | 9 +- .../Downloader.swift | 0 .../DownloaderTest.swift | 0 {MNIST/MNISTTests => MNISTTests}/Info.plist | 2 - .../MNISTTests-Bridging-Header.h | 1 - MNISTTests/MNISTTests.swift | 16 + {MNIST/MNISTTests => MNISTTests}/SHA1.swift | 0 MNISTUITests/Info.plist | 22 + MNISTUITests/MNISTUITests.swift | 36 + TensorSwift.xcodeproj/project.pbxproj | 726 ++++++++++++++++++ 34 files changed, 823 insertions(+), 666 deletions(-) rename MNIST/{MNIST => }/AppDelegate.swift (86%) rename MNIST/{MNIST => }/Assets.xcassets/AppIcon.appiconset/Contents.json (100%) rename MNIST/{MNIST => }/Base.lproj/LaunchScreen.storyboard (100%) rename MNIST/{MNIST => }/Base.lproj/Main.storyboard (100%) rename MNIST/{MNIST => }/Canvas.swift (100%) rename MNIST/{MNIST => }/CanvasView.swift (100%) rename MNIST/{MNIST => }/Classifier.swift (100%) rename MNIST/{MNIST => }/Info.plist (96%) rename MNIST/{MNIST => }/Line.swift (100%) delete mode 100644 MNIST/MNIST.xcodeproj/project.pbxproj delete mode 100644 MNIST/MNIST.xcodeproj/project.xcworkspace/contents.xcworkspacedata delete mode 100644 MNIST/MNISTTests/Header.h delete mode 100644 MNIST/MNISTTests/MNISTTest.swift rename MNIST/{MNIST => }/Models/W_conv1 (100%) rename MNIST/{MNIST => }/Models/W_conv2 (100%) rename MNIST/{MNIST => }/Models/W_fc1 (100%) rename MNIST/{MNIST => }/Models/W_fc2 (100%) rename MNIST/{MNIST => }/Models/b_conv1 (100%) rename MNIST/{MNIST => }/Models/b_conv2 (100%) rename MNIST/{MNIST => }/Models/b_fc1 (100%) rename MNIST/{MNIST => }/Models/b_fc2 (100%) rename MNIST/{MNIST => }/String.swift (100%) rename MNIST/{MNIST => }/ViewController.swift (100%) rename {MNIST/MNISTTests => MNISTTests}/Array.swift (100%) rename {MNIST/MNISTTests => MNISTTests}/ClassifierTest.swift (86%) rename {MNIST/MNISTTests => MNISTTests}/Downloader.swift (100%) rename {MNIST/MNISTTests => MNISTTests}/DownloaderTest.swift (100%) rename {MNIST/MNISTTests => MNISTTests}/Info.plist (94%) rename {MNIST/MNISTTests => MNISTTests}/MNISTTests-Bridging-Header.h (99%) create mode 100644 MNISTTests/MNISTTests.swift rename {MNIST/MNISTTests => MNISTTests}/SHA1.swift (100%) create mode 100644 MNISTUITests/Info.plist create mode 100644 MNISTUITests/MNISTUITests.swift diff --git a/MNIST/MNIST/AppDelegate.swift b/MNIST/AppDelegate.swift similarity index 86% rename from MNIST/MNIST/AppDelegate.swift rename to MNIST/AppDelegate.swift index d386cb2..9d6a5bf 100644 --- a/MNIST/MNIST/AppDelegate.swift +++ b/MNIST/AppDelegate.swift @@ -1,3 +1,11 @@ +// +// AppDelegate.swift +// MNIST +// +// Created by Araki Takehiro on 2016/10/01. +// +// + import UIKit @UIApplicationMain @@ -13,7 +21,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { func applicationWillResignActive(_ application: UIApplication) { // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. - // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. + // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. } func applicationDidEnterBackground(_ application: UIApplication) { @@ -22,7 +30,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { } func applicationWillEnterForeground(_ application: UIApplication) { - // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. + // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. } func applicationDidBecomeActive(_ application: UIApplication) { diff --git a/MNIST/MNIST/Assets.xcassets/AppIcon.appiconset/Contents.json b/MNIST/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from MNIST/MNIST/Assets.xcassets/AppIcon.appiconset/Contents.json rename to MNIST/Assets.xcassets/AppIcon.appiconset/Contents.json diff --git a/MNIST/MNIST/Base.lproj/LaunchScreen.storyboard b/MNIST/Base.lproj/LaunchScreen.storyboard similarity index 100% rename from MNIST/MNIST/Base.lproj/LaunchScreen.storyboard rename to MNIST/Base.lproj/LaunchScreen.storyboard diff --git a/MNIST/MNIST/Base.lproj/Main.storyboard b/MNIST/Base.lproj/Main.storyboard similarity index 100% rename from MNIST/MNIST/Base.lproj/Main.storyboard rename to MNIST/Base.lproj/Main.storyboard diff --git a/MNIST/MNIST/Canvas.swift b/MNIST/Canvas.swift similarity index 100% rename from MNIST/MNIST/Canvas.swift rename to MNIST/Canvas.swift diff --git a/MNIST/MNIST/CanvasView.swift b/MNIST/CanvasView.swift similarity index 100% rename from MNIST/MNIST/CanvasView.swift rename to MNIST/CanvasView.swift diff --git a/MNIST/MNIST/Classifier.swift b/MNIST/Classifier.swift similarity index 100% rename from MNIST/MNIST/Classifier.swift rename to MNIST/Classifier.swift diff --git a/MNIST/MNIST/Info.plist b/MNIST/Info.plist similarity index 96% rename from MNIST/MNIST/Info.plist rename to MNIST/Info.plist index 40a5271..8aed6ca 100644 --- a/MNIST/MNIST/Info.plist +++ b/MNIST/Info.plist @@ -2,16 +2,6 @@ - NSAppTransportSecurity - - NSExceptionDomains - - yann.lecun.com - - - NSAllowsArbitraryLoads - - CFBundleDevelopmentRegion en CFBundleExecutable @@ -26,8 +16,6 @@ APPL CFBundleShortVersionString 1.0 - CFBundleSignature - ???? CFBundleVersion 1 LSRequiresIPhoneOS @@ -53,5 +41,15 @@ UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight + NSAppTransportSecurity + + NSExceptionDomains + + yann.lecun.com + + + NSAllowsArbitraryLoads + + diff --git a/MNIST/MNIST/Line.swift b/MNIST/Line.swift similarity index 100% rename from MNIST/MNIST/Line.swift rename to MNIST/Line.swift diff --git a/MNIST/MNIST.xcodeproj/project.pbxproj b/MNIST/MNIST.xcodeproj/project.pbxproj deleted file mode 100644 index a8a592c..0000000 --- a/MNIST/MNIST.xcodeproj/project.pbxproj +++ /dev/null @@ -1,619 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - A7DF6EC41D9A1B4A0097CEB7 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7DF6EC31D9A1B4A0097CEB7 /* AppDelegate.swift */; }; - A7DF6EC61D9A1B4A0097CEB7 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7DF6EC51D9A1B4A0097CEB7 /* ViewController.swift */; }; - A7DF6EC91D9A1B4A0097CEB7 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A7DF6EC71D9A1B4A0097CEB7 /* Main.storyboard */; }; - A7DF6ECB1D9A1B4A0097CEB7 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A7DF6ECA1D9A1B4A0097CEB7 /* Assets.xcassets */; }; - A7DF6ECE1D9A1B4A0097CEB7 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A7DF6ECC1D9A1B4A0097CEB7 /* LaunchScreen.storyboard */; }; - A7DF6EFA1D9A1B7D0097CEB7 /* TensorSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A7DF6EF71D9A1B5B0097CEB7 /* TensorSwift.framework */; }; - A7DF6EFB1D9A1B7D0097CEB7 /* TensorSwift.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = A7DF6EF71D9A1B5B0097CEB7 /* TensorSwift.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - A7DF6F0D1D9A1BC90097CEB7 /* Canvas.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7DF6EFF1D9A1BC90097CEB7 /* Canvas.swift */; }; - A7DF6F0E1D9A1BC90097CEB7 /* CanvasView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7DF6F001D9A1BC90097CEB7 /* CanvasView.swift */; }; - A7DF6F0F1D9A1BC90097CEB7 /* Classifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7DF6F011D9A1BC90097CEB7 /* Classifier.swift */; }; - A7DF6F101D9A1BC90097CEB7 /* Line.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7DF6F021D9A1BC90097CEB7 /* Line.swift */; }; - A7DF6F111D9A1BC90097CEB7 /* b_conv1 in Resources */ = {isa = PBXBuildFile; fileRef = A7DF6F041D9A1BC90097CEB7 /* b_conv1 */; }; - A7DF6F121D9A1BC90097CEB7 /* b_conv2 in Resources */ = {isa = PBXBuildFile; fileRef = A7DF6F051D9A1BC90097CEB7 /* b_conv2 */; }; - A7DF6F131D9A1BC90097CEB7 /* b_fc1 in Resources */ = {isa = PBXBuildFile; fileRef = A7DF6F061D9A1BC90097CEB7 /* b_fc1 */; }; - A7DF6F141D9A1BC90097CEB7 /* b_fc2 in Resources */ = {isa = PBXBuildFile; fileRef = A7DF6F071D9A1BC90097CEB7 /* b_fc2 */; }; - A7DF6F151D9A1BC90097CEB7 /* W_conv1 in Resources */ = {isa = PBXBuildFile; fileRef = A7DF6F081D9A1BC90097CEB7 /* W_conv1 */; }; - A7DF6F161D9A1BC90097CEB7 /* W_conv2 in Resources */ = {isa = PBXBuildFile; fileRef = A7DF6F091D9A1BC90097CEB7 /* W_conv2 */; }; - A7DF6F171D9A1BC90097CEB7 /* W_fc1 in Resources */ = {isa = PBXBuildFile; fileRef = A7DF6F0A1D9A1BC90097CEB7 /* W_fc1 */; }; - A7DF6F181D9A1BC90097CEB7 /* W_fc2 in Resources */ = {isa = PBXBuildFile; fileRef = A7DF6F0B1D9A1BC90097CEB7 /* W_fc2 */; }; - A7DF6F191D9A1BC90097CEB7 /* String.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7DF6F0C1D9A1BC90097CEB7 /* String.swift */; }; - A7DF6F231D9A1BDA0097CEB7 /* Array.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7DF6F1B1D9A1BDA0097CEB7 /* Array.swift */; }; - A7DF6F241D9A1BDA0097CEB7 /* ClassifierTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7DF6F1C1D9A1BDA0097CEB7 /* ClassifierTest.swift */; }; - A7DF6F251D9A1BDA0097CEB7 /* Downloader.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7DF6F1D1D9A1BDA0097CEB7 /* Downloader.swift */; }; - A7DF6F261D9A1BDA0097CEB7 /* DownloaderTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7DF6F1E1D9A1BDA0097CEB7 /* DownloaderTest.swift */; }; - A7DF6F271D9A1BDA0097CEB7 /* MNISTTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7DF6F201D9A1BDA0097CEB7 /* MNISTTest.swift */; }; - A7DF6F281D9A1BDA0097CEB7 /* SHA1.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7DF6F221D9A1BDA0097CEB7 /* SHA1.swift */; }; - A7DF6F2F1D9A24650097CEB7 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = A7DF6F2D1D9A1DA40097CEB7 /* libz.tbd */; }; - A7DF6F351D9A26180097CEB7 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = A7DF6F2D1D9A1DA40097CEB7 /* libz.tbd */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - A7DF6ED51D9A1B4A0097CEB7 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = A7DF6EB81D9A1B4A0097CEB7 /* Project object */; - proxyType = 1; - remoteGlobalIDString = A7DF6EBF1D9A1B4A0097CEB7; - remoteInfo = MNIST; - }; - A7DF6EF61D9A1B5B0097CEB7 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = A7DF6EF11D9A1B5B0097CEB7 /* TensorSwift.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = "_____Product_TensorSwift"; - remoteInfo = TensorSwift; - }; - A7DF6EF81D9A1B5B0097CEB7 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = A7DF6EF11D9A1B5B0097CEB7 /* TensorSwift.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = "_____Product_TensorSwiftTests"; - remoteInfo = TensorSwiftTests; - }; - A7DF6EFC1D9A1B7D0097CEB7 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = A7DF6EF11D9A1B5B0097CEB7 /* TensorSwift.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = "______Target_TensorSwift"; - remoteInfo = TensorSwift; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXCopyFilesBuildPhase section */ - A7DF6EFE1D9A1B7D0097CEB7 /* Embed Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - A7DF6EFB1D9A1B7D0097CEB7 /* TensorSwift.framework in Embed Frameworks */, - ); - name = "Embed Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - A7DF6EC01D9A1B4A0097CEB7 /* MNIST.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MNIST.app; sourceTree = BUILT_PRODUCTS_DIR; }; - A7DF6EC31D9A1B4A0097CEB7 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - A7DF6EC51D9A1B4A0097CEB7 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; - A7DF6EC81D9A1B4A0097CEB7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - A7DF6ECA1D9A1B4A0097CEB7 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - A7DF6ECD1D9A1B4A0097CEB7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - A7DF6ECF1D9A1B4A0097CEB7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - A7DF6ED41D9A1B4A0097CEB7 /* MNISTTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MNISTTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - A7DF6EDA1D9A1B4A0097CEB7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - A7DF6EF11D9A1B5B0097CEB7 /* TensorSwift.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = TensorSwift.xcodeproj; path = ../TensorSwift.xcodeproj; sourceTree = ""; }; - A7DF6EFF1D9A1BC90097CEB7 /* Canvas.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Canvas.swift; sourceTree = ""; }; - A7DF6F001D9A1BC90097CEB7 /* CanvasView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CanvasView.swift; sourceTree = ""; }; - A7DF6F011D9A1BC90097CEB7 /* Classifier.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Classifier.swift; sourceTree = ""; }; - A7DF6F021D9A1BC90097CEB7 /* Line.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Line.swift; sourceTree = ""; }; - A7DF6F041D9A1BC90097CEB7 /* b_conv1 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = b_conv1; sourceTree = ""; }; - A7DF6F051D9A1BC90097CEB7 /* b_conv2 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = b_conv2; sourceTree = ""; }; - A7DF6F061D9A1BC90097CEB7 /* b_fc1 */ = {isa = PBXFileReference; lastKnownFileType = file; path = b_fc1; sourceTree = ""; }; - A7DF6F071D9A1BC90097CEB7 /* b_fc2 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = b_fc2; sourceTree = ""; }; - A7DF6F081D9A1BC90097CEB7 /* W_conv1 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = W_conv1; sourceTree = ""; }; - A7DF6F091D9A1BC90097CEB7 /* W_conv2 */ = {isa = PBXFileReference; lastKnownFileType = file; path = W_conv2; sourceTree = ""; }; - A7DF6F0A1D9A1BC90097CEB7 /* W_fc1 */ = {isa = PBXFileReference; lastKnownFileType = file; path = W_fc1; sourceTree = ""; }; - A7DF6F0B1D9A1BC90097CEB7 /* W_fc2 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = W_fc2; sourceTree = ""; }; - A7DF6F0C1D9A1BC90097CEB7 /* String.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = String.swift; sourceTree = ""; }; - A7DF6F1A1D9A1BD90097CEB7 /* MNISTTests-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "MNISTTests-Bridging-Header.h"; sourceTree = ""; }; - A7DF6F1B1D9A1BDA0097CEB7 /* Array.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Array.swift; sourceTree = ""; }; - A7DF6F1C1D9A1BDA0097CEB7 /* ClassifierTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ClassifierTest.swift; sourceTree = ""; }; - A7DF6F1D1D9A1BDA0097CEB7 /* Downloader.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Downloader.swift; sourceTree = ""; }; - A7DF6F1E1D9A1BDA0097CEB7 /* DownloaderTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DownloaderTest.swift; sourceTree = ""; }; - A7DF6F1F1D9A1BDA0097CEB7 /* Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Header.h; sourceTree = ""; }; - A7DF6F201D9A1BDA0097CEB7 /* MNISTTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MNISTTest.swift; sourceTree = ""; }; - A7DF6F221D9A1BDA0097CEB7 /* SHA1.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SHA1.swift; sourceTree = ""; }; - A7DF6F2D1D9A1DA40097CEB7 /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - A7DF6EBD1D9A1B4A0097CEB7 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - A7DF6F2F1D9A24650097CEB7 /* libz.tbd in Frameworks */, - A7DF6EFA1D9A1B7D0097CEB7 /* TensorSwift.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - A7DF6ED11D9A1B4A0097CEB7 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - A7DF6F351D9A26180097CEB7 /* libz.tbd in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - A7DF6EB71D9A1B4A0097CEB7 = { - isa = PBXGroup; - children = ( - A7DF6EF11D9A1B5B0097CEB7 /* TensorSwift.xcodeproj */, - A7DF6EC21D9A1B4A0097CEB7 /* MNIST */, - A7DF6ED71D9A1B4A0097CEB7 /* MNISTTests */, - A7DF6EC11D9A1B4A0097CEB7 /* Products */, - A7DF6F2C1D9A1DA40097CEB7 /* Frameworks */, - ); - sourceTree = ""; - }; - A7DF6EC11D9A1B4A0097CEB7 /* Products */ = { - isa = PBXGroup; - children = ( - A7DF6EC01D9A1B4A0097CEB7 /* MNIST.app */, - A7DF6ED41D9A1B4A0097CEB7 /* MNISTTests.xctest */, - ); - name = Products; - sourceTree = ""; - }; - A7DF6EC21D9A1B4A0097CEB7 /* MNIST */ = { - isa = PBXGroup; - children = ( - A7DF6EC31D9A1B4A0097CEB7 /* AppDelegate.swift */, - A7DF6EC51D9A1B4A0097CEB7 /* ViewController.swift */, - A7DF6EFF1D9A1BC90097CEB7 /* Canvas.swift */, - A7DF6F001D9A1BC90097CEB7 /* CanvasView.swift */, - A7DF6F011D9A1BC90097CEB7 /* Classifier.swift */, - A7DF6F021D9A1BC90097CEB7 /* Line.swift */, - A7DF6F031D9A1BC90097CEB7 /* Models */, - A7DF6F0C1D9A1BC90097CEB7 /* String.swift */, - A7DF6EC71D9A1B4A0097CEB7 /* Main.storyboard */, - A7DF6ECA1D9A1B4A0097CEB7 /* Assets.xcassets */, - A7DF6ECC1D9A1B4A0097CEB7 /* LaunchScreen.storyboard */, - A7DF6ECF1D9A1B4A0097CEB7 /* Info.plist */, - ); - path = MNIST; - sourceTree = ""; - }; - A7DF6ED71D9A1B4A0097CEB7 /* MNISTTests */ = { - isa = PBXGroup; - children = ( - A7DF6F1B1D9A1BDA0097CEB7 /* Array.swift */, - A7DF6F1D1D9A1BDA0097CEB7 /* Downloader.swift */, - A7DF6F1E1D9A1BDA0097CEB7 /* DownloaderTest.swift */, - A7DF6F1C1D9A1BDA0097CEB7 /* ClassifierTest.swift */, - A7DF6F1F1D9A1BDA0097CEB7 /* Header.h */, - A7DF6F201D9A1BDA0097CEB7 /* MNISTTest.swift */, - A7DF6F221D9A1BDA0097CEB7 /* SHA1.swift */, - A7DF6EDA1D9A1B4A0097CEB7 /* Info.plist */, - A7DF6F1A1D9A1BD90097CEB7 /* MNISTTests-Bridging-Header.h */, - ); - path = MNISTTests; - sourceTree = ""; - }; - A7DF6EF21D9A1B5B0097CEB7 /* Products */ = { - isa = PBXGroup; - children = ( - A7DF6EF71D9A1B5B0097CEB7 /* TensorSwift.framework */, - A7DF6EF91D9A1B5B0097CEB7 /* TensorSwiftTests.xctest */, - ); - name = Products; - sourceTree = ""; - }; - A7DF6F031D9A1BC90097CEB7 /* Models */ = { - isa = PBXGroup; - children = ( - A7DF6F041D9A1BC90097CEB7 /* b_conv1 */, - A7DF6F051D9A1BC90097CEB7 /* b_conv2 */, - A7DF6F061D9A1BC90097CEB7 /* b_fc1 */, - A7DF6F071D9A1BC90097CEB7 /* b_fc2 */, - A7DF6F081D9A1BC90097CEB7 /* W_conv1 */, - A7DF6F091D9A1BC90097CEB7 /* W_conv2 */, - A7DF6F0A1D9A1BC90097CEB7 /* W_fc1 */, - A7DF6F0B1D9A1BC90097CEB7 /* W_fc2 */, - ); - path = Models; - sourceTree = ""; - }; - A7DF6F2C1D9A1DA40097CEB7 /* Frameworks */ = { - isa = PBXGroup; - children = ( - A7DF6F2D1D9A1DA40097CEB7 /* libz.tbd */, - ); - name = Frameworks; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - A7DF6EBF1D9A1B4A0097CEB7 /* MNIST */ = { - isa = PBXNativeTarget; - buildConfigurationList = A7DF6EE81D9A1B4A0097CEB7 /* Build configuration list for PBXNativeTarget "MNIST" */; - buildPhases = ( - A7DF6EBC1D9A1B4A0097CEB7 /* Sources */, - A7DF6EBD1D9A1B4A0097CEB7 /* Frameworks */, - A7DF6EBE1D9A1B4A0097CEB7 /* Resources */, - A7DF6EFE1D9A1B7D0097CEB7 /* Embed Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - A7DF6EFD1D9A1B7D0097CEB7 /* PBXTargetDependency */, - ); - name = MNIST; - productName = MNIST; - productReference = A7DF6EC01D9A1B4A0097CEB7 /* MNIST.app */; - productType = "com.apple.product-type.application"; - }; - A7DF6ED31D9A1B4A0097CEB7 /* MNISTTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = A7DF6EEB1D9A1B4A0097CEB7 /* Build configuration list for PBXNativeTarget "MNISTTests" */; - buildPhases = ( - A7DF6ED01D9A1B4A0097CEB7 /* Sources */, - A7DF6ED11D9A1B4A0097CEB7 /* Frameworks */, - A7DF6ED21D9A1B4A0097CEB7 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - A7DF6ED61D9A1B4A0097CEB7 /* PBXTargetDependency */, - ); - name = MNISTTests; - productName = MNISTTests; - productReference = A7DF6ED41D9A1B4A0097CEB7 /* MNISTTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - A7DF6EB81D9A1B4A0097CEB7 /* Project object */ = { - isa = PBXProject; - attributes = { - LastSwiftUpdateCheck = 0800; - LastUpgradeCheck = 0800; - ORGANIZATIONNAME = "Araki Takehiro"; - TargetAttributes = { - A7DF6EBF1D9A1B4A0097CEB7 = { - CreatedOnToolsVersion = 8.0; - LastSwiftMigration = 0800; - ProvisioningStyle = Automatic; - }; - A7DF6ED31D9A1B4A0097CEB7 = { - CreatedOnToolsVersion = 8.0; - LastSwiftMigration = 0800; - ProvisioningStyle = Automatic; - TestTargetID = A7DF6EBF1D9A1B4A0097CEB7; - }; - }; - }; - buildConfigurationList = A7DF6EBB1D9A1B4A0097CEB7 /* Build configuration list for PBXProject "MNIST" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = A7DF6EB71D9A1B4A0097CEB7; - productRefGroup = A7DF6EC11D9A1B4A0097CEB7 /* Products */; - projectDirPath = ""; - projectReferences = ( - { - ProductGroup = A7DF6EF21D9A1B5B0097CEB7 /* Products */; - ProjectRef = A7DF6EF11D9A1B5B0097CEB7 /* TensorSwift.xcodeproj */; - }, - ); - projectRoot = ""; - targets = ( - A7DF6EBF1D9A1B4A0097CEB7 /* MNIST */, - A7DF6ED31D9A1B4A0097CEB7 /* MNISTTests */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXReferenceProxy section */ - A7DF6EF71D9A1B5B0097CEB7 /* TensorSwift.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = TensorSwift.framework; - remoteRef = A7DF6EF61D9A1B5B0097CEB7 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - A7DF6EF91D9A1B5B0097CEB7 /* TensorSwiftTests.xctest */ = { - isa = PBXReferenceProxy; - fileType = wrapper.cfbundle; - path = TensorSwiftTests.xctest; - remoteRef = A7DF6EF81D9A1B5B0097CEB7 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; -/* End PBXReferenceProxy section */ - -/* Begin PBXResourcesBuildPhase section */ - A7DF6EBE1D9A1B4A0097CEB7 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - A7DF6F181D9A1BC90097CEB7 /* W_fc2 in Resources */, - A7DF6F131D9A1BC90097CEB7 /* b_fc1 in Resources */, - A7DF6F171D9A1BC90097CEB7 /* W_fc1 in Resources */, - A7DF6F141D9A1BC90097CEB7 /* b_fc2 in Resources */, - A7DF6F121D9A1BC90097CEB7 /* b_conv2 in Resources */, - A7DF6F161D9A1BC90097CEB7 /* W_conv2 in Resources */, - A7DF6ECE1D9A1B4A0097CEB7 /* LaunchScreen.storyboard in Resources */, - A7DF6F151D9A1BC90097CEB7 /* W_conv1 in Resources */, - A7DF6ECB1D9A1B4A0097CEB7 /* Assets.xcassets in Resources */, - A7DF6EC91D9A1B4A0097CEB7 /* Main.storyboard in Resources */, - A7DF6F111D9A1BC90097CEB7 /* b_conv1 in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - A7DF6ED21D9A1B4A0097CEB7 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - A7DF6EBC1D9A1B4A0097CEB7 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - A7DF6F0F1D9A1BC90097CEB7 /* Classifier.swift in Sources */, - A7DF6EC61D9A1B4A0097CEB7 /* ViewController.swift in Sources */, - A7DF6EC41D9A1B4A0097CEB7 /* AppDelegate.swift in Sources */, - A7DF6F101D9A1BC90097CEB7 /* Line.swift in Sources */, - A7DF6F191D9A1BC90097CEB7 /* String.swift in Sources */, - A7DF6F0E1D9A1BC90097CEB7 /* CanvasView.swift in Sources */, - A7DF6F0D1D9A1BC90097CEB7 /* Canvas.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - A7DF6ED01D9A1B4A0097CEB7 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - A7DF6F241D9A1BDA0097CEB7 /* ClassifierTest.swift in Sources */, - A7DF6F231D9A1BDA0097CEB7 /* Array.swift in Sources */, - A7DF6F281D9A1BDA0097CEB7 /* SHA1.swift in Sources */, - A7DF6F271D9A1BDA0097CEB7 /* MNISTTest.swift in Sources */, - A7DF6F261D9A1BDA0097CEB7 /* DownloaderTest.swift in Sources */, - A7DF6F251D9A1BDA0097CEB7 /* Downloader.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - A7DF6ED61D9A1B4A0097CEB7 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = A7DF6EBF1D9A1B4A0097CEB7 /* MNIST */; - targetProxy = A7DF6ED51D9A1B4A0097CEB7 /* PBXContainerItemProxy */; - }; - A7DF6EFD1D9A1B7D0097CEB7 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = TensorSwift; - targetProxy = A7DF6EFC1D9A1B7D0097CEB7 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin PBXVariantGroup section */ - A7DF6EC71D9A1B4A0097CEB7 /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - A7DF6EC81D9A1B4A0097CEB7 /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - A7DF6ECC1D9A1B4A0097CEB7 /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - A7DF6ECD1D9A1B4A0097CEB7 /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - A7DF6EE61D9A1B4A0097CEB7 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_SUSPICIOUS_MOVES = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - A7DF6EE71D9A1B4A0097CEB7 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_SUSPICIOUS_MOVES = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - A7DF6EE91D9A1B4A0097CEB7 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - DEVELOPMENT_TEAM = ""; - INFOPLIST_FILE = MNIST/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - OTHER_LDFLAGS = ""; - PRODUCT_BUNDLE_IDENTIFIER = jp.co.qoncept.MNIST; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_INCLUDE_PATHS = ""; - SWIFT_VERSION = 3.0; - }; - name = Debug; - }; - A7DF6EEA1D9A1B4A0097CEB7 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - DEVELOPMENT_TEAM = ""; - INFOPLIST_FILE = MNIST/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - OTHER_LDFLAGS = ""; - PRODUCT_BUNDLE_IDENTIFIER = jp.co.qoncept.MNIST; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_INCLUDE_PATHS = ""; - SWIFT_VERSION = 3.0; - }; - name = Release; - }; - A7DF6EEC1D9A1B4A0097CEB7 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; - BUNDLE_LOADER = "$(TEST_HOST)"; - CLANG_ENABLE_MODULES = YES; - DEVELOPMENT_TEAM = ""; - INFOPLIST_FILE = MNISTTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = jp.co.qoncept.MNISTTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OBJC_BRIDGING_HEADER = "MNISTTests/MNISTTests-Bridging-Header.h"; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/MNIST.app/MNIST"; - }; - name = Debug; - }; - A7DF6EED1D9A1B4A0097CEB7 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; - BUNDLE_LOADER = "$(TEST_HOST)"; - CLANG_ENABLE_MODULES = YES; - DEVELOPMENT_TEAM = ""; - INFOPLIST_FILE = MNISTTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = jp.co.qoncept.MNISTTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OBJC_BRIDGING_HEADER = "MNISTTests/MNISTTests-Bridging-Header.h"; - SWIFT_VERSION = 3.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/MNIST.app/MNIST"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - A7DF6EBB1D9A1B4A0097CEB7 /* Build configuration list for PBXProject "MNIST" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - A7DF6EE61D9A1B4A0097CEB7 /* Debug */, - A7DF6EE71D9A1B4A0097CEB7 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - A7DF6EE81D9A1B4A0097CEB7 /* Build configuration list for PBXNativeTarget "MNIST" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - A7DF6EE91D9A1B4A0097CEB7 /* Debug */, - A7DF6EEA1D9A1B4A0097CEB7 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - A7DF6EEB1D9A1B4A0097CEB7 /* Build configuration list for PBXNativeTarget "MNISTTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - A7DF6EEC1D9A1B4A0097CEB7 /* Debug */, - A7DF6EED1D9A1B4A0097CEB7 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = A7DF6EB81D9A1B4A0097CEB7 /* Project object */; -} diff --git a/MNIST/MNIST.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/MNIST/MNIST.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index f66f8a3..0000000 --- a/MNIST/MNIST.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/MNIST/MNISTTests/Header.h b/MNIST/MNISTTests/Header.h deleted file mode 100644 index 5269eae..0000000 --- a/MNIST/MNISTTests/Header.h +++ /dev/null @@ -1,12 +0,0 @@ -// -// Header.h -// TensorSwift -// -// Created by 松下日昇 on 2016/04/05. -// Copyright © 2016年 Qoncept, Inc. All rights reserved. -// - -#ifndef Header_h -#define Header_h - -#endif /* Header_h */ diff --git a/MNIST/MNISTTests/MNISTTest.swift b/MNIST/MNISTTests/MNISTTest.swift deleted file mode 100644 index 38276e9..0000000 --- a/MNIST/MNISTTests/MNISTTest.swift +++ /dev/null @@ -1,5 +0,0 @@ -import XCTest -import MNIST - -class MNISTTest: XCTestCase { -} diff --git a/MNIST/MNIST/Models/W_conv1 b/MNIST/Models/W_conv1 similarity index 100% rename from MNIST/MNIST/Models/W_conv1 rename to MNIST/Models/W_conv1 diff --git a/MNIST/MNIST/Models/W_conv2 b/MNIST/Models/W_conv2 similarity index 100% rename from MNIST/MNIST/Models/W_conv2 rename to MNIST/Models/W_conv2 diff --git a/MNIST/MNIST/Models/W_fc1 b/MNIST/Models/W_fc1 similarity index 100% rename from MNIST/MNIST/Models/W_fc1 rename to MNIST/Models/W_fc1 diff --git a/MNIST/MNIST/Models/W_fc2 b/MNIST/Models/W_fc2 similarity index 100% rename from MNIST/MNIST/Models/W_fc2 rename to MNIST/Models/W_fc2 diff --git a/MNIST/MNIST/Models/b_conv1 b/MNIST/Models/b_conv1 similarity index 100% rename from MNIST/MNIST/Models/b_conv1 rename to MNIST/Models/b_conv1 diff --git a/MNIST/MNIST/Models/b_conv2 b/MNIST/Models/b_conv2 similarity index 100% rename from MNIST/MNIST/Models/b_conv2 rename to MNIST/Models/b_conv2 diff --git a/MNIST/MNIST/Models/b_fc1 b/MNIST/Models/b_fc1 similarity index 100% rename from MNIST/MNIST/Models/b_fc1 rename to MNIST/Models/b_fc1 diff --git a/MNIST/MNIST/Models/b_fc2 b/MNIST/Models/b_fc2 similarity index 100% rename from MNIST/MNIST/Models/b_fc2 rename to MNIST/Models/b_fc2 diff --git a/MNIST/MNIST/String.swift b/MNIST/String.swift similarity index 100% rename from MNIST/MNIST/String.swift rename to MNIST/String.swift diff --git a/MNIST/MNIST/ViewController.swift b/MNIST/ViewController.swift similarity index 100% rename from MNIST/MNIST/ViewController.swift rename to MNIST/ViewController.swift diff --git a/MNIST/MNISTTests/Array.swift b/MNISTTests/Array.swift similarity index 100% rename from MNIST/MNISTTests/Array.swift rename to MNISTTests/Array.swift diff --git a/MNIST/MNISTTests/ClassifierTest.swift b/MNISTTests/ClassifierTest.swift similarity index 86% rename from MNIST/MNISTTests/ClassifierTest.swift rename to MNISTTests/ClassifierTest.swift index a631469..3110546 100644 --- a/MNIST/MNISTTests/ClassifierTest.swift +++ b/MNISTTests/ClassifierTest.swift @@ -8,21 +8,18 @@ class ClassifierTest: XCTestCase { let classifier = Classifier(path: Bundle(for: ViewController.self).resourcePath!) let (images, labels) = downloadTestData() - print("start") - - let count = 10000 + let count = 1000 let xArray: [[Float]] = images.withUnsafeBytes { ptr in [UInt8](UnsafeBufferPointer(start: UnsafePointer(ptr + 16), count: 28 * 28 * count)) .map { Float($0) / 255.0 } .grouped(28 * 28) } - print("made xArray") + let yArray: [Int] = labels.withUnsafeBytes { ptr in [UInt8](UnsafeBufferPointer(start: UnsafePointer(ptr + 8), count: count)) .map { Int($0) } } - print("made yArray") let accuracy = Float(zip(xArray, yArray) .reduce(0) { $0 + (classifier.classify(Tensor(shape: [28, 28, 1], elements: $1.0)) == $1.1 ? 1 : 0) }) @@ -30,6 +27,6 @@ class ClassifierTest: XCTestCase { print("accuracy: \(accuracy)") - XCTAssertGreaterThan(accuracy, 0.99) + XCTAssertGreaterThan(accuracy, 0.97) } } diff --git a/MNIST/MNISTTests/Downloader.swift b/MNISTTests/Downloader.swift similarity index 100% rename from MNIST/MNISTTests/Downloader.swift rename to MNISTTests/Downloader.swift diff --git a/MNIST/MNISTTests/DownloaderTest.swift b/MNISTTests/DownloaderTest.swift similarity index 100% rename from MNIST/MNISTTests/DownloaderTest.swift rename to MNISTTests/DownloaderTest.swift diff --git a/MNIST/MNISTTests/Info.plist b/MNISTTests/Info.plist similarity index 94% rename from MNIST/MNISTTests/Info.plist rename to MNISTTests/Info.plist index 8b954c3..a0c1b32 100644 --- a/MNIST/MNISTTests/Info.plist +++ b/MNISTTests/Info.plist @@ -26,8 +26,6 @@ BNDL CFBundleShortVersionString 1.0 - CFBundleSignature - ???? CFBundleVersion 1 diff --git a/MNIST/MNISTTests/MNISTTests-Bridging-Header.h b/MNISTTests/MNISTTests-Bridging-Header.h similarity index 99% rename from MNIST/MNISTTests/MNISTTests-Bridging-Header.h rename to MNISTTests/MNISTTests-Bridging-Header.h index e1b7713..a762601 100644 --- a/MNIST/MNISTTests/MNISTTests-Bridging-Header.h +++ b/MNISTTests/MNISTTests-Bridging-Header.h @@ -4,5 +4,4 @@ #import #import "zlib.h" - #endif /* MNISTTests_Bridging_Header_h */ diff --git a/MNISTTests/MNISTTests.swift b/MNISTTests/MNISTTests.swift new file mode 100644 index 0000000..860d337 --- /dev/null +++ b/MNISTTests/MNISTTests.swift @@ -0,0 +1,16 @@ +import XCTest +@testable import MNIST + +class MNISTTests: XCTestCase { + + override func setUp() { + super.setUp() + // Put setup code here. This method is called before the invocation of each test method in the class. + } + + override func tearDown() { + // Put teardown code here. This method is called after the invocation of each test method in the class. + super.tearDown() + } + +} diff --git a/MNIST/MNISTTests/SHA1.swift b/MNISTTests/SHA1.swift similarity index 100% rename from MNIST/MNISTTests/SHA1.swift rename to MNISTTests/SHA1.swift diff --git a/MNISTUITests/Info.plist b/MNISTUITests/Info.plist new file mode 100644 index 0000000..6c6c23c --- /dev/null +++ b/MNISTUITests/Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + + diff --git a/MNISTUITests/MNISTUITests.swift b/MNISTUITests/MNISTUITests.swift new file mode 100644 index 0000000..25c2ef8 --- /dev/null +++ b/MNISTUITests/MNISTUITests.swift @@ -0,0 +1,36 @@ +// +// MNISTUITests.swift +// MNISTUITests +// +// Created by Araki Takehiro on 2016/10/01. +// +// + +import XCTest + +class MNISTUITests: XCTestCase { + + override func setUp() { + super.setUp() + + // Put setup code here. This method is called before the invocation of each test method in the class. + + // In UI tests it is usually best to stop immediately when a failure occurs. + continueAfterFailure = false + // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. + XCUIApplication().launch() + + // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. + } + + override func tearDown() { + // Put teardown code here. This method is called after the invocation of each test method in the class. + super.tearDown() + } + + func testExample() { + // Use recording to get started writing UI tests. + // Use XCTAssert and related functions to verify your tests produce the correct results. + } + +} diff --git a/TensorSwift.xcodeproj/project.pbxproj b/TensorSwift.xcodeproj/project.pbxproj index b3ab55d..855bd60 100644 --- a/TensorSwift.xcodeproj/project.pbxproj +++ b/TensorSwift.xcodeproj/project.pbxproj @@ -14,6 +14,34 @@ A7C0460D1D9F514600FAF16F /* TensorNNTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7DF6F851D9BB9240097CEB7 /* TensorNNTests.swift */; }; A7C0460E1D9F514600FAF16F /* TensorSwiftSample.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7DF6F861D9BB9240097CEB7 /* TensorSwiftSample.swift */; }; A7C0460F1D9F514600FAF16F /* TensorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7DF6F871D9BB9240097CEB7 /* TensorTests.swift */; }; + A7C387A91D9F604900091506 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7C387A81D9F604900091506 /* AppDelegate.swift */; }; + A7C387AB1D9F604900091506 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7C387AA1D9F604900091506 /* ViewController.swift */; }; + A7C387AE1D9F604900091506 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A7C387AC1D9F604900091506 /* Main.storyboard */; }; + A7C387B01D9F604900091506 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A7C387AF1D9F604900091506 /* Assets.xcassets */; }; + A7C387B31D9F604900091506 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A7C387B11D9F604900091506 /* LaunchScreen.storyboard */; }; + A7C387BE1D9F604900091506 /* MNISTTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7C387BD1D9F604900091506 /* MNISTTests.swift */; }; + A7C387C91D9F604A00091506 /* MNISTUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7C387C81D9F604A00091506 /* MNISTUITests.swift */; }; + A7C387D91D9F60F100091506 /* Canvas.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7C387D41D9F60F100091506 /* Canvas.swift */; }; + A7C387DA1D9F60F100091506 /* CanvasView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7C387D51D9F60F100091506 /* CanvasView.swift */; }; + A7C387DB1D9F60F100091506 /* Classifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7C387D61D9F60F100091506 /* Classifier.swift */; }; + A7C387DC1D9F60F100091506 /* Line.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7C387D71D9F60F100091506 /* Line.swift */; }; + A7C387DD1D9F60F100091506 /* String.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7C387D81D9F60F100091506 /* String.swift */; }; + A7C387DE1D9F611D00091506 /* TensorSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = "_____Product_TensorSwift" /* TensorSwift.framework */; }; + A7C387DF1D9F611D00091506 /* TensorSwift.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = "_____Product_TensorSwift" /* TensorSwift.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + A7C387E91D9F614E00091506 /* Array.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7C387E31D9F614E00091506 /* Array.swift */; }; + A7C387EA1D9F614E00091506 /* ClassifierTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7C387E41D9F614E00091506 /* ClassifierTest.swift */; }; + A7C387EB1D9F614E00091506 /* Downloader.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7C387E51D9F614E00091506 /* Downloader.swift */; }; + A7C387EC1D9F614F00091506 /* DownloaderTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7C387E61D9F614E00091506 /* DownloaderTest.swift */; }; + A7C387ED1D9F614F00091506 /* SHA1.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7C387E81D9F614E00091506 /* SHA1.swift */; }; + A7C387F71D9F616600091506 /* b_conv1 in Resources */ = {isa = PBXBuildFile; fileRef = A7C387EF1D9F616600091506 /* b_conv1 */; }; + A7C387F81D9F616600091506 /* b_conv2 in Resources */ = {isa = PBXBuildFile; fileRef = A7C387F01D9F616600091506 /* b_conv2 */; }; + A7C387F91D9F616600091506 /* b_fc1 in Resources */ = {isa = PBXBuildFile; fileRef = A7C387F11D9F616600091506 /* b_fc1 */; }; + A7C387FA1D9F616600091506 /* b_fc2 in Resources */ = {isa = PBXBuildFile; fileRef = A7C387F21D9F616600091506 /* b_fc2 */; }; + A7C387FB1D9F616600091506 /* W_conv1 in Resources */ = {isa = PBXBuildFile; fileRef = A7C387F31D9F616600091506 /* W_conv1 */; }; + A7C387FC1D9F616600091506 /* W_conv2 in Resources */ = {isa = PBXBuildFile; fileRef = A7C387F41D9F616600091506 /* W_conv2 */; }; + A7C387FD1D9F616600091506 /* W_fc1 in Resources */ = {isa = PBXBuildFile; fileRef = A7C387F51D9F616600091506 /* W_fc1 */; }; + A7C387FE1D9F616600091506 /* W_fc2 in Resources */ = {isa = PBXBuildFile; fileRef = A7C387F61D9F616600091506 /* W_fc2 */; }; + A7C388031D9F629A00091506 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = A7C388001D9F619000091506 /* libz.tbd */; }; _LinkFileRef_TensorSwift_via_TensorSwiftTests /* TensorSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = "_____Product_TensorSwift" /* TensorSwift.framework */; }; __src_cc_ref_Sources/Dimension.swift /* Dimension.swift in Sources */ = {isa = PBXBuildFile; fileRef = __PBXFileRef_Sources/Dimension.swift /* Dimension.swift */; }; __src_cc_ref_Sources/Operators.swift /* Operators.swift in Sources */ = {isa = PBXBuildFile; fileRef = __PBXFileRef_Sources/Operators.swift /* Operators.swift */; }; @@ -25,6 +53,27 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ + A7C387BA1D9F604900091506 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = __RootObject_ /* Project object */; + proxyType = 1; + remoteGlobalIDString = A7C387A51D9F604900091506; + remoteInfo = MNIST; + }; + A7C387C51D9F604A00091506 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = __RootObject_ /* Project object */; + proxyType = 1; + remoteGlobalIDString = A7C387A51D9F604900091506; + remoteInfo = MNIST; + }; + A7C387E01D9F611D00091506 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = __RootObject_ /* Project object */; + proxyType = 1; + remoteGlobalIDString = "______Target_TensorSwift"; + remoteInfo = TensorSwift; + }; A7DF6EB61D9A1AC40097CEB7 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = __RootObject_ /* Project object */; @@ -34,7 +83,54 @@ }; /* End PBXContainerItemProxy section */ +/* Begin PBXCopyFilesBuildPhase section */ + A7C387E21D9F611E00091506 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + A7C387DF1D9F611D00091506 /* TensorSwift.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + /* Begin PBXFileReference section */ + A7C387A61D9F604900091506 /* MNIST.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MNIST.app; sourceTree = BUILT_PRODUCTS_DIR; }; + A7C387A81D9F604900091506 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + A7C387AA1D9F604900091506 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + A7C387AD1D9F604900091506 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + A7C387AF1D9F604900091506 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + A7C387B21D9F604900091506 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + A7C387B41D9F604900091506 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + A7C387B91D9F604900091506 /* MNISTTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MNISTTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + A7C387BD1D9F604900091506 /* MNISTTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MNISTTests.swift; sourceTree = ""; }; + A7C387BF1D9F604900091506 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + A7C387C41D9F604A00091506 /* MNISTUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MNISTUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + A7C387C81D9F604A00091506 /* MNISTUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MNISTUITests.swift; sourceTree = ""; }; + A7C387CA1D9F604A00091506 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + A7C387D41D9F60F100091506 /* Canvas.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Canvas.swift; sourceTree = ""; }; + A7C387D51D9F60F100091506 /* CanvasView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CanvasView.swift; sourceTree = ""; }; + A7C387D61D9F60F100091506 /* Classifier.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Classifier.swift; sourceTree = ""; }; + A7C387D71D9F60F100091506 /* Line.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Line.swift; sourceTree = ""; }; + A7C387D81D9F60F100091506 /* String.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = String.swift; sourceTree = ""; }; + A7C387E31D9F614E00091506 /* Array.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Array.swift; sourceTree = ""; }; + A7C387E41D9F614E00091506 /* ClassifierTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ClassifierTest.swift; sourceTree = ""; }; + A7C387E51D9F614E00091506 /* Downloader.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Downloader.swift; sourceTree = ""; }; + A7C387E61D9F614E00091506 /* DownloaderTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DownloaderTest.swift; sourceTree = ""; }; + A7C387E71D9F614E00091506 /* MNISTTests-Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MNISTTests-Bridging-Header.h"; sourceTree = ""; }; + A7C387E81D9F614E00091506 /* SHA1.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SHA1.swift; sourceTree = ""; }; + A7C387EF1D9F616600091506 /* b_conv1 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = b_conv1; sourceTree = ""; }; + A7C387F01D9F616600091506 /* b_conv2 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = b_conv2; sourceTree = ""; }; + A7C387F11D9F616600091506 /* b_fc1 */ = {isa = PBXFileReference; lastKnownFileType = file; path = b_fc1; sourceTree = ""; }; + A7C387F21D9F616600091506 /* b_fc2 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = b_fc2; sourceTree = ""; }; + A7C387F31D9F616600091506 /* W_conv1 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = W_conv1; sourceTree = ""; }; + A7C387F41D9F616600091506 /* W_conv2 */ = {isa = PBXFileReference; lastKnownFileType = file; path = W_conv2; sourceTree = ""; }; + A7C387F51D9F616600091506 /* W_fc1 */ = {isa = PBXFileReference; lastKnownFileType = file; path = W_fc1; sourceTree = ""; }; + A7C387F61D9F616600091506 /* W_fc2 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = W_fc2; sourceTree = ""; }; + A7C388001D9F619000091506 /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.0.sdk/usr/lib/libz.tbd; sourceTree = DEVELOPER_DIR; }; A7DF6F811D9BB9240097CEB7 /* CalculationPerformanceTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CalculationPerformanceTests.swift; sourceTree = ""; }; A7DF6F821D9BB9240097CEB7 /* DimensionTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DimensionTests.swift; sourceTree = ""; }; A7DF6F841D9BB9240097CEB7 /* PowerTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PowerTests.swift; sourceTree = ""; }; @@ -57,6 +153,29 @@ /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ + A7C387A31D9F604900091506 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + A7C387DE1D9F611D00091506 /* TensorSwift.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A7C387B61D9F604900091506 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + A7C388031D9F629A00091506 /* libz.tbd in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A7C387C11D9F604A00091506 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; "___LinkPhase_TensorSwift" /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 0; @@ -75,6 +194,72 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + A7C387A71D9F604900091506 /* MNIST */ = { + isa = PBXGroup; + children = ( + A7C387EE1D9F616600091506 /* Models */, + A7C387A81D9F604900091506 /* AppDelegate.swift */, + A7C387AA1D9F604900091506 /* ViewController.swift */, + A7C387D41D9F60F100091506 /* Canvas.swift */, + A7C387D51D9F60F100091506 /* CanvasView.swift */, + A7C387D61D9F60F100091506 /* Classifier.swift */, + A7C387D71D9F60F100091506 /* Line.swift */, + A7C387D81D9F60F100091506 /* String.swift */, + A7C387AC1D9F604900091506 /* Main.storyboard */, + A7C387AF1D9F604900091506 /* Assets.xcassets */, + A7C387B11D9F604900091506 /* LaunchScreen.storyboard */, + A7C387B41D9F604900091506 /* Info.plist */, + ); + path = MNIST; + sourceTree = ""; + }; + A7C387BC1D9F604900091506 /* MNISTTests */ = { + isa = PBXGroup; + children = ( + A7C387BD1D9F604900091506 /* MNISTTests.swift */, + A7C387E51D9F614E00091506 /* Downloader.swift */, + A7C387E61D9F614E00091506 /* DownloaderTest.swift */, + A7C387E31D9F614E00091506 /* Array.swift */, + A7C387E81D9F614E00091506 /* SHA1.swift */, + A7C387E41D9F614E00091506 /* ClassifierTest.swift */, + A7C387E71D9F614E00091506 /* MNISTTests-Bridging-Header.h */, + A7C387BF1D9F604900091506 /* Info.plist */, + ); + path = MNISTTests; + sourceTree = ""; + }; + A7C387C71D9F604A00091506 /* MNISTUITests */ = { + isa = PBXGroup; + children = ( + A7C387C81D9F604A00091506 /* MNISTUITests.swift */, + A7C387CA1D9F604A00091506 /* Info.plist */, + ); + path = MNISTUITests; + sourceTree = ""; + }; + A7C387EE1D9F616600091506 /* Models */ = { + isa = PBXGroup; + children = ( + A7C387EF1D9F616600091506 /* b_conv1 */, + A7C387F01D9F616600091506 /* b_conv2 */, + A7C387F11D9F616600091506 /* b_fc1 */, + A7C387F21D9F616600091506 /* b_fc2 */, + A7C387F31D9F616600091506 /* W_conv1 */, + A7C387F41D9F616600091506 /* W_conv2 */, + A7C387F51D9F616600091506 /* W_fc1 */, + A7C387F61D9F616600091506 /* W_fc2 */, + ); + path = Models; + sourceTree = ""; + }; + A7C387FF1D9F619000091506 /* Frameworks */ = { + isa = PBXGroup; + children = ( + A7C388001D9F619000091506 /* libz.tbd */, + ); + name = Frameworks; + sourceTree = ""; + }; TestProducts_ /* Tests */ = { isa = PBXGroup; children = ( @@ -91,7 +276,11 @@ "_____Sources_" /* Sources */, __PBXFileRef_Resources /* Resources */, "_______Tests_" /* Tests */, + A7C387A71D9F604900091506 /* MNIST */, + A7C387BC1D9F604900091506 /* MNISTTests */, + A7C387C71D9F604A00091506 /* MNISTUITests */, "____Products_" /* Products */, + A7C387FF1D9F619000091506 /* Frameworks */, ); sourceTree = ""; }; @@ -100,6 +289,9 @@ children = ( TestProducts_ /* Tests */, "_____Product_TensorSwift" /* TensorSwift.framework */, + A7C387A61D9F604900091506 /* MNIST.app */, + A7C387B91D9F604900091506 /* MNISTTests.xctest */, + A7C387C41D9F604A00091506 /* MNISTUITests.xctest */, ); name = Products; sourceTree = ""; @@ -161,6 +353,61 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ + A7C387A51D9F604900091506 /* MNIST */ = { + isa = PBXNativeTarget; + buildConfigurationList = A7C387D11D9F604A00091506 /* Build configuration list for PBXNativeTarget "MNIST" */; + buildPhases = ( + A7C387A21D9F604900091506 /* Sources */, + A7C387A31D9F604900091506 /* Frameworks */, + A7C387A41D9F604900091506 /* Resources */, + A7C387E21D9F611E00091506 /* Embed Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + A7C387E11D9F611D00091506 /* PBXTargetDependency */, + ); + name = MNIST; + productName = MNIST; + productReference = A7C387A61D9F604900091506 /* MNIST.app */; + productType = "com.apple.product-type.application"; + }; + A7C387B81D9F604900091506 /* MNISTTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = A7C387D21D9F604A00091506 /* Build configuration list for PBXNativeTarget "MNISTTests" */; + buildPhases = ( + A7C387B51D9F604900091506 /* Sources */, + A7C387B61D9F604900091506 /* Frameworks */, + A7C387B71D9F604900091506 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + A7C387BB1D9F604900091506 /* PBXTargetDependency */, + ); + name = MNISTTests; + productName = MNISTTests; + productReference = A7C387B91D9F604900091506 /* MNISTTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + A7C387C31D9F604A00091506 /* MNISTUITests */ = { + isa = PBXNativeTarget; + buildConfigurationList = A7C387D31D9F604A00091506 /* Build configuration list for PBXNativeTarget "MNISTUITests" */; + buildPhases = ( + A7C387C01D9F604A00091506 /* Sources */, + A7C387C11D9F604A00091506 /* Frameworks */, + A7C387C21D9F604A00091506 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + A7C387C61D9F604A00091506 /* PBXTargetDependency */, + ); + name = MNISTUITests; + productName = MNISTUITests; + productReference = A7C387C41D9F604A00091506 /* MNISTUITests.xctest */; + productType = "com.apple.product-type.bundle.ui-testing"; + }; "______Target_TensorSwift" /* TensorSwift */ = { isa = PBXNativeTarget; buildConfigurationList = "_______Confs_TensorSwift" /* Build configuration list for PBXNativeTarget "TensorSwift" */; @@ -200,8 +447,26 @@ __RootObject_ /* Project object */ = { isa = PBXProject; attributes = { + LastSwiftUpdateCheck = 0800; LastUpgradeCheck = 9999; TargetAttributes = { + A7C387A51D9F604900091506 = { + CreatedOnToolsVersion = 8.0; + DevelopmentTeam = 3B8C483UAP; + ProvisioningStyle = Automatic; + }; + A7C387B81D9F604900091506 = { + CreatedOnToolsVersion = 8.0; + DevelopmentTeam = 3B8C483UAP; + ProvisioningStyle = Automatic; + TestTargetID = A7C387A51D9F604900091506; + }; + A7C387C31D9F604A00091506 = { + CreatedOnToolsVersion = 8.0; + DevelopmentTeam = 3B8C483UAP; + ProvisioningStyle = Automatic; + TestTargetID = A7C387A51D9F604900091506; + }; "______Target_TensorSwiftTests" = { LastSwiftMigration = 0800; }; @@ -213,6 +478,7 @@ hasScannedForEncodings = 0; knownRegions = ( en, + Base, ); mainGroup = "___RootGroup_"; productRefGroup = "____Products_" /* Products */; @@ -221,11 +487,84 @@ targets = ( "______Target_TensorSwift" /* TensorSwift */, "______Target_TensorSwiftTests" /* TensorSwiftTests */, + A7C387A51D9F604900091506 /* MNIST */, + A7C387B81D9F604900091506 /* MNISTTests */, + A7C387C31D9F604A00091506 /* MNISTUITests */, ); }; /* End PBXProject section */ +/* Begin PBXResourcesBuildPhase section */ + A7C387A41D9F604900091506 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + A7C387FE1D9F616600091506 /* W_fc2 in Resources */, + A7C387F91D9F616600091506 /* b_fc1 in Resources */, + A7C387FD1D9F616600091506 /* W_fc1 in Resources */, + A7C387FA1D9F616600091506 /* b_fc2 in Resources */, + A7C387F81D9F616600091506 /* b_conv2 in Resources */, + A7C387FC1D9F616600091506 /* W_conv2 in Resources */, + A7C387B31D9F604900091506 /* LaunchScreen.storyboard in Resources */, + A7C387FB1D9F616600091506 /* W_conv1 in Resources */, + A7C387B01D9F604900091506 /* Assets.xcassets in Resources */, + A7C387AE1D9F604900091506 /* Main.storyboard in Resources */, + A7C387F71D9F616600091506 /* b_conv1 in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A7C387B71D9F604900091506 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A7C387C21D9F604A00091506 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + /* Begin PBXSourcesBuildPhase section */ + A7C387A21D9F604900091506 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + A7C387DB1D9F60F100091506 /* Classifier.swift in Sources */, + A7C387AB1D9F604900091506 /* ViewController.swift in Sources */, + A7C387A91D9F604900091506 /* AppDelegate.swift in Sources */, + A7C387DC1D9F60F100091506 /* Line.swift in Sources */, + A7C387DD1D9F60F100091506 /* String.swift in Sources */, + A7C387DA1D9F60F100091506 /* CanvasView.swift in Sources */, + A7C387D91D9F60F100091506 /* Canvas.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A7C387B51D9F604900091506 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + A7C387BE1D9F604900091506 /* MNISTTests.swift in Sources */, + A7C387EC1D9F614F00091506 /* DownloaderTest.swift in Sources */, + A7C387ED1D9F614F00091506 /* SHA1.swift in Sources */, + A7C387E91D9F614E00091506 /* Array.swift in Sources */, + A7C387EB1D9F614E00091506 /* Downloader.swift in Sources */, + A7C387EA1D9F614E00091506 /* ClassifierTest.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A7C387C01D9F604A00091506 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + A7C387C91D9F604A00091506 /* MNISTUITests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; CompilePhase_TensorSwift /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 0; @@ -257,6 +596,21 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ + A7C387BB1D9F604900091506 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = A7C387A51D9F604900091506 /* MNIST */; + targetProxy = A7C387BA1D9F604900091506 /* PBXContainerItemProxy */; + }; + A7C387C61D9F604A00091506 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = A7C387A51D9F604900091506 /* MNIST */; + targetProxy = A7C387C51D9F604A00091506 /* PBXContainerItemProxy */; + }; + A7C387E11D9F611D00091506 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = "______Target_TensorSwift" /* TensorSwift */; + targetProxy = A7C387E01D9F611D00091506 /* PBXContainerItemProxy */; + }; __Dependency_TensorSwift /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = "______Target_TensorSwift" /* TensorSwift */; @@ -264,10 +618,357 @@ }; /* End PBXTargetDependency section */ +/* Begin PBXVariantGroup section */ + A7C387AC1D9F604900091506 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + A7C387AD1D9F604900091506 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + A7C387B11D9F604900091506 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + A7C387B21D9F604900091506 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + /* Begin XCBuildConfiguration section */ + A7C387CB1D9F604A00091506 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + DEVELOPMENT_TEAM = 3B8C483UAP; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + INFOPLIST_FILE = MNIST/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_BUNDLE_IDENTIFIER = jp.co.qoncept.MNIST; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + A7C387CC1D9F604A00091506 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEVELOPMENT_TEAM = 3B8C483UAP; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + INFOPLIST_FILE = MNIST/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_BUNDLE_IDENTIFIER = jp.co.qoncept.MNIST; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + A7C387CD1D9F604A00091506 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + ALWAYS_SEARCH_USER_PATHS = NO; + BUNDLE_LOADER = "$(TEST_HOST)"; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + DEVELOPMENT_TEAM = 3B8C483UAP; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + INFOPLIST_FILE = MNISTTests/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_BUNDLE_IDENTIFIER = jp.co.qoncept.MNISTTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OBJC_BRIDGING_HEADER = "MNISTTests/MNISTTests-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 3.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/MNIST.app/MNIST"; + }; + name = Debug; + }; + A7C387CE1D9F604A00091506 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + ALWAYS_SEARCH_USER_PATHS = NO; + BUNDLE_LOADER = "$(TEST_HOST)"; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEVELOPMENT_TEAM = 3B8C483UAP; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + INFOPLIST_FILE = MNISTTests/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_BUNDLE_IDENTIFIER = jp.co.qoncept.MNISTTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + SWIFT_OBJC_BRIDGING_HEADER = "MNISTTests/MNISTTests-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 3.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/MNIST.app/MNIST"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + A7C387CF1D9F604A00091506 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + DEVELOPMENT_TEAM = 3B8C483UAP; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + INFOPLIST_FILE = MNISTUITests/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_BUNDLE_IDENTIFIER = jp.co.qoncept.MNISTUITests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 3.0; + TEST_TARGET_NAME = MNIST; + }; + name = Debug; + }; + A7C387D01D9F604A00091506 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEVELOPMENT_TEAM = 3B8C483UAP; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + INFOPLIST_FILE = MNISTUITests/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_BUNDLE_IDENTIFIER = jp.co.qoncept.MNISTUITests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 3.0; + TEST_TARGET_NAME = MNIST; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; _ReleaseConf_TensorSwift /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + DEVELOPMENT_TEAM = 3B8C483UAP; ENABLE_TESTABILITY = YES; FRAMEWORK_SEARCH_PATHS = "$(PLATFORM_DIR)/Developer/Library/Frameworks"; INFOPLIST_FILE = TensorSwift.xcodeproj/TensorSwift_Info.plist; @@ -299,6 +1000,7 @@ "___DebugConf_TensorSwift" /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + DEVELOPMENT_TEAM = ""; ENABLE_TESTABILITY = YES; FRAMEWORK_SEARCH_PATHS = "$(PLATFORM_DIR)/Developer/Library/Frameworks"; INFOPLIST_FILE = TensorSwift.xcodeproj/TensorSwift_Info.plist; @@ -346,6 +1048,30 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ + A7C387D11D9F604A00091506 /* Build configuration list for PBXNativeTarget "MNIST" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + A7C387CB1D9F604A00091506 /* Debug */, + A7C387CC1D9F604A00091506 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; + A7C387D21D9F604A00091506 /* Build configuration list for PBXNativeTarget "MNISTTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + A7C387CD1D9F604A00091506 /* Debug */, + A7C387CE1D9F604A00091506 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; + A7C387D31D9F604A00091506 /* Build configuration list for PBXNativeTarget "MNISTUITests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + A7C387CF1D9F604A00091506 /* Debug */, + A7C387D01D9F604A00091506 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; "___RootConfs_" /* Build configuration list for PBXProject "TensorSwift" */ = { isa = XCConfigurationList; buildConfigurations = ( From a4a3815c04798f035f0be14b605309a66b958cf7 Mon Sep 17 00:00:00 2001 From: araki Date: Sat, 1 Oct 2016 12:30:41 +0900 Subject: [PATCH 14/26] Rename tests --- ...lassifierTest.swift => ClassifierTests.swift} | 2 +- ...ownloaderTest.swift => DownloaderTests.swift} | 2 +- TensorSwift.xcodeproj/project.pbxproj | 16 ++++++++-------- 3 files changed, 10 insertions(+), 10 deletions(-) rename MNISTTests/{ClassifierTest.swift => ClassifierTests.swift} (96%) rename MNISTTests/{DownloaderTest.swift => DownloaderTests.swift} (87%) diff --git a/MNISTTests/ClassifierTest.swift b/MNISTTests/ClassifierTests.swift similarity index 96% rename from MNISTTests/ClassifierTest.swift rename to MNISTTests/ClassifierTests.swift index 3110546..aed32fd 100644 --- a/MNISTTests/ClassifierTest.swift +++ b/MNISTTests/ClassifierTests.swift @@ -2,7 +2,7 @@ import XCTest import TensorSwift @testable import MNIST -class ClassifierTest: XCTestCase { +class ClassifierTests: XCTestCase { func testClassify() { let classifier = Classifier(path: Bundle(for: ViewController.self).resourcePath!) diff --git a/MNISTTests/DownloaderTest.swift b/MNISTTests/DownloaderTests.swift similarity index 87% rename from MNISTTests/DownloaderTest.swift rename to MNISTTests/DownloaderTests.swift index e6b69ca..56eaf4b 100644 --- a/MNISTTests/DownloaderTest.swift +++ b/MNISTTests/DownloaderTests.swift @@ -1,6 +1,6 @@ import XCTest -class Downloader: XCTestCase { +class DownloaderTests: XCTestCase { func testDownloadTestData() { let testData = downloadTestData() diff --git a/TensorSwift.xcodeproj/project.pbxproj b/TensorSwift.xcodeproj/project.pbxproj index 855bd60..3971666 100644 --- a/TensorSwift.xcodeproj/project.pbxproj +++ b/TensorSwift.xcodeproj/project.pbxproj @@ -29,9 +29,9 @@ A7C387DE1D9F611D00091506 /* TensorSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = "_____Product_TensorSwift" /* TensorSwift.framework */; }; A7C387DF1D9F611D00091506 /* TensorSwift.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = "_____Product_TensorSwift" /* TensorSwift.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; A7C387E91D9F614E00091506 /* Array.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7C387E31D9F614E00091506 /* Array.swift */; }; - A7C387EA1D9F614E00091506 /* ClassifierTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7C387E41D9F614E00091506 /* ClassifierTest.swift */; }; + A7C387EA1D9F614E00091506 /* ClassifierTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7C387E41D9F614E00091506 /* ClassifierTests.swift */; }; A7C387EB1D9F614E00091506 /* Downloader.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7C387E51D9F614E00091506 /* Downloader.swift */; }; - A7C387EC1D9F614F00091506 /* DownloaderTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7C387E61D9F614E00091506 /* DownloaderTest.swift */; }; + A7C387EC1D9F614F00091506 /* DownloaderTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7C387E61D9F614E00091506 /* DownloaderTests.swift */; }; A7C387ED1D9F614F00091506 /* SHA1.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7C387E81D9F614E00091506 /* SHA1.swift */; }; A7C387F71D9F616600091506 /* b_conv1 in Resources */ = {isa = PBXBuildFile; fileRef = A7C387EF1D9F616600091506 /* b_conv1 */; }; A7C387F81D9F616600091506 /* b_conv2 in Resources */ = {isa = PBXBuildFile; fileRef = A7C387F01D9F616600091506 /* b_conv2 */; }; @@ -117,9 +117,9 @@ A7C387D71D9F60F100091506 /* Line.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Line.swift; sourceTree = ""; }; A7C387D81D9F60F100091506 /* String.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = String.swift; sourceTree = ""; }; A7C387E31D9F614E00091506 /* Array.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Array.swift; sourceTree = ""; }; - A7C387E41D9F614E00091506 /* ClassifierTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ClassifierTest.swift; sourceTree = ""; }; + A7C387E41D9F614E00091506 /* ClassifierTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ClassifierTests.swift; sourceTree = ""; }; A7C387E51D9F614E00091506 /* Downloader.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Downloader.swift; sourceTree = ""; }; - A7C387E61D9F614E00091506 /* DownloaderTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DownloaderTest.swift; sourceTree = ""; }; + A7C387E61D9F614E00091506 /* DownloaderTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DownloaderTests.swift; sourceTree = ""; }; A7C387E71D9F614E00091506 /* MNISTTests-Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MNISTTests-Bridging-Header.h"; sourceTree = ""; }; A7C387E81D9F614E00091506 /* SHA1.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SHA1.swift; sourceTree = ""; }; A7C387EF1D9F616600091506 /* b_conv1 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = b_conv1; sourceTree = ""; }; @@ -218,10 +218,10 @@ children = ( A7C387BD1D9F604900091506 /* MNISTTests.swift */, A7C387E51D9F614E00091506 /* Downloader.swift */, - A7C387E61D9F614E00091506 /* DownloaderTest.swift */, + A7C387E61D9F614E00091506 /* DownloaderTests.swift */, A7C387E31D9F614E00091506 /* Array.swift */, A7C387E81D9F614E00091506 /* SHA1.swift */, - A7C387E41D9F614E00091506 /* ClassifierTest.swift */, + A7C387E41D9F614E00091506 /* ClassifierTests.swift */, A7C387E71D9F614E00091506 /* MNISTTests-Bridging-Header.h */, A7C387BF1D9F604900091506 /* Info.plist */, ); @@ -549,11 +549,11 @@ buildActionMask = 2147483647; files = ( A7C387BE1D9F604900091506 /* MNISTTests.swift in Sources */, - A7C387EC1D9F614F00091506 /* DownloaderTest.swift in Sources */, + A7C387EC1D9F614F00091506 /* DownloaderTests.swift in Sources */, A7C387ED1D9F614F00091506 /* SHA1.swift in Sources */, A7C387E91D9F614E00091506 /* Array.swift in Sources */, A7C387EB1D9F614E00091506 /* Downloader.swift in Sources */, - A7C387EA1D9F614E00091506 /* ClassifierTest.swift in Sources */, + A7C387EA1D9F614E00091506 /* ClassifierTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; From 0d5346122c18a55fb81e9f2ef08935e60f61649a Mon Sep 17 00:00:00 2001 From: araki Date: Sat, 1 Oct 2016 12:31:06 +0900 Subject: [PATCH 15/26] Delete header --- MNIST/AppDelegate.swift | 8 -------- 1 file changed, 8 deletions(-) diff --git a/MNIST/AppDelegate.swift b/MNIST/AppDelegate.swift index 9d6a5bf..ecede7f 100644 --- a/MNIST/AppDelegate.swift +++ b/MNIST/AppDelegate.swift @@ -1,11 +1,3 @@ -// -// AppDelegate.swift -// MNIST -// -// Created by Araki Takehiro on 2016/10/01. -// -// - import UIKit @UIApplicationMain From 4351459526122360e453688d3ab9a278a7282cfc Mon Sep 17 00:00:00 2001 From: araki Date: Sat, 1 Oct 2016 12:42:54 +0900 Subject: [PATCH 16/26] Add xcscheme --- .../xcschemes/TensorSwift.xcscheme | 99 +++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 TensorSwift.xcodeproj/xcshareddata/xcschemes/TensorSwift.xcscheme diff --git a/TensorSwift.xcodeproj/xcshareddata/xcschemes/TensorSwift.xcscheme b/TensorSwift.xcodeproj/xcshareddata/xcschemes/TensorSwift.xcscheme new file mode 100644 index 0000000..e882410 --- /dev/null +++ b/TensorSwift.xcodeproj/xcshareddata/xcschemes/TensorSwift.xcscheme @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 8111c9540b0418771f51bee135a128ffea1dbd3f Mon Sep 17 00:00:00 2001 From: Yuta Koshizawa Date: Mon, 24 Oct 2016 19:31:26 +0900 Subject: [PATCH 17/26] Implement `testPow` --- TensorSwift.xcodeproj/project.pbxproj | 4 +++ Tests/TensorSwiftTests/TensorMathTest.swift | 34 +++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 Tests/TensorSwiftTests/TensorMathTest.swift diff --git a/TensorSwift.xcodeproj/project.pbxproj b/TensorSwift.xcodeproj/project.pbxproj index 3971666..c8db367 100644 --- a/TensorSwift.xcodeproj/project.pbxproj +++ b/TensorSwift.xcodeproj/project.pbxproj @@ -42,6 +42,7 @@ A7C387FD1D9F616600091506 /* W_fc1 in Resources */ = {isa = PBXBuildFile; fileRef = A7C387F51D9F616600091506 /* W_fc1 */; }; A7C387FE1D9F616600091506 /* W_fc2 in Resources */ = {isa = PBXBuildFile; fileRef = A7C387F61D9F616600091506 /* W_fc2 */; }; A7C388031D9F629A00091506 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = A7C388001D9F619000091506 /* libz.tbd */; }; + D646CEF61DBE1A25003E8A59 /* TensorMathTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = D646CEF51DBE1A25003E8A59 /* TensorMathTest.swift */; }; _LinkFileRef_TensorSwift_via_TensorSwiftTests /* TensorSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = "_____Product_TensorSwift" /* TensorSwift.framework */; }; __src_cc_ref_Sources/Dimension.swift /* Dimension.swift in Sources */ = {isa = PBXBuildFile; fileRef = __PBXFileRef_Sources/Dimension.swift /* Dimension.swift */; }; __src_cc_ref_Sources/Operators.swift /* Operators.swift in Sources */ = {isa = PBXBuildFile; fileRef = __PBXFileRef_Sources/Operators.swift /* Operators.swift */; }; @@ -138,6 +139,7 @@ A7DF6F861D9BB9240097CEB7 /* TensorSwiftSample.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TensorSwiftSample.swift; sourceTree = ""; }; A7DF6F871D9BB9240097CEB7 /* TensorTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TensorTests.swift; sourceTree = ""; }; A7DF6F8E1D9BB9660097CEB7 /* TensorSwiftTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TensorSwiftTests.swift; sourceTree = ""; }; + D646CEF51DBE1A25003E8A59 /* TensorMathTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TensorMathTest.swift; sourceTree = ""; }; __PBXFileRef_Package.swift /* Package.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Package.swift; sourceTree = ""; }; __PBXFileRef_Resources /* Resources */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Resources; sourceTree = ""; }; __PBXFileRef_Sources/Dimension.swift /* Dimension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Dimension.swift; sourceTree = ""; }; @@ -334,6 +336,7 @@ A7DF6F811D9BB9240097CEB7 /* CalculationPerformanceTests.swift */, A7DF6F821D9BB9240097CEB7 /* DimensionTests.swift */, A7DF6F841D9BB9240097CEB7 /* PowerTests.swift */, + D646CEF51DBE1A25003E8A59 /* TensorMathTest.swift */, A7DF6F851D9BB9240097CEB7 /* TensorNNTests.swift */, A7DF6F861D9BB9240097CEB7 /* TensorSwiftSample.swift */, A7DF6F871D9BB9240097CEB7 /* TensorTests.swift */, @@ -587,6 +590,7 @@ A7C0460A1D9F514600FAF16F /* CalculationPerformanceTests.swift in Sources */, A7C0460B1D9F514600FAF16F /* DimensionTests.swift in Sources */, A7C0460C1D9F514600FAF16F /* PowerTests.swift in Sources */, + D646CEF61DBE1A25003E8A59 /* TensorMathTest.swift in Sources */, A7C0460D1D9F514600FAF16F /* TensorNNTests.swift in Sources */, A7C0460E1D9F514600FAF16F /* TensorSwiftSample.swift in Sources */, A7C0460F1D9F514600FAF16F /* TensorTests.swift in Sources */, diff --git a/Tests/TensorSwiftTests/TensorMathTest.swift b/Tests/TensorSwiftTests/TensorMathTest.swift new file mode 100644 index 0000000..e03f710 --- /dev/null +++ b/Tests/TensorSwiftTests/TensorMathTest.swift @@ -0,0 +1,34 @@ +import XCTest +@testable import TensorSwift + +class TensorMathTest: XCTestCase { + func testPow() { + do { + let a = Tensor(shape: [2, 3], elements: [1, 2, 3, 4, 5, 6]) + let b = Tensor(shape: [2, 3], elements: [6, 5, 4, 3, 2, 1]) + XCTAssertEqual(a ** b, Tensor(shape: [2, 3], elements: [1, 32, 81, 64, 25, 6])) + XCTAssertEqual(b ** a, Tensor(shape: [2, 3], elements: [6, 25, 64, 81, 32, 1])) + } + + do { + let a = Tensor(shape: [2, 3, 2], elements: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]) + let b = Tensor(shape: [2], elements: [2, 3]) + XCTAssertEqual(a ** b, Tensor(shape: [2, 3, 2], elements: [1, 8, 9, 64, 25, 216, 49, 512, 81, 1000, 121, 1728])) + XCTAssertEqual(b ** a, Tensor(shape: [2, 3, 2], elements: [2, 9, 8, 81, 32, 729, 128, 6561, 512, 59049, 2048, 531441])) + } + + do { + let a = Tensor(shape: [2, 1, 3, 2], elements: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]) + let b = Tensor(shape: [3, 2], elements: [6, 5, 4, 3, 2, 1]) + XCTAssertEqual(a ** b, Tensor(shape: [2, 1, 3, 2], elements: [1, 32, 81, 64, 25, 6, 117649, 32768, 6561, 1000, 121, 12])) + XCTAssertEqual(b ** a, Tensor(shape: [2, 1, 3, 2], elements: [6, 25, 64, 81, 32, 1, 279936, 390625, 262144, 59049, 2048, 1])) + } + + do { + let a = Tensor(shape: [2, 3], elements: [1, 2, 3, 4, 5, 6]) + let b: Float = 2.0 + XCTAssertEqual(a ** b, Tensor(shape: [2, 3], elements: [1, 4, 9, 16, 25, 36])) + XCTAssertEqual(b ** a, Tensor(shape: [2, 3], elements: [2, 4, 8, 16, 32, 64])) + } + } +} \ No newline at end of file From 6ba3306407186f77af4e3ba9da55cccc675bda0d Mon Sep 17 00:00:00 2001 From: Yuta Koshizawa Date: Mon, 24 Oct 2016 19:33:07 +0900 Subject: [PATCH 18/26] Change the test for `/` to test both `a / b` and `b / a` --- Tests/TensorSwiftTests/TensorTests.swift | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Tests/TensorSwiftTests/TensorTests.swift b/Tests/TensorSwiftTests/TensorTests.swift index 3cbe415..8462901 100644 --- a/Tests/TensorSwiftTests/TensorTests.swift +++ b/Tests/TensorSwiftTests/TensorTests.swift @@ -74,8 +74,8 @@ class TensorTests: XCTestCase { do { let a = Tensor(shape: [2, 3], elements: [1, 2, 3, 4, 5, 6]) let b = Tensor(shape: [2, 3], elements: [7, 8, 9, 10, 11, 12]) - let r = a * b - XCTAssertEqual(r, Tensor(shape: [2, 3], elements: [7, 16, 27, 40, 55, 72])) + XCTAssertEqual(a * b, Tensor(shape: [2, 3], elements: [7, 16, 27, 40, 55, 72])) + XCTAssertEqual(b * a, Tensor(shape: [2, 3], elements: [7, 16, 27, 40, 55, 72])) } do { @@ -93,7 +93,7 @@ class TensorTests: XCTestCase { } do { - let a = Tensor(shape:[2, 3], elements: [ 1, 2, 3, 4, 5, 6]) + let a = Tensor(shape: [2, 3], elements: [1, 2, 3, 4, 5, 6]) let b: Float = 2.0 XCTAssertEqual(a * b, Tensor(shape: [2, 3], elements: [2, 4, 6, 8, 10, 12])) XCTAssertEqual(b * a, Tensor(shape: [2, 3], elements: [2, 4, 6, 8, 10, 12])) @@ -102,10 +102,10 @@ class TensorTests: XCTestCase { func testDiv() { do { - let a = Tensor(shape: [2, 3], elements: [1, 2, 3, 4, 5, 6]) + let a = Tensor(shape: [2, 3], elements: [2048, 512, 128, 32, 8, 2]) let b = Tensor(shape: [2, 3], elements: [2, 4, 8, 16, 32, 64]) - let r = a / b - XCTAssertEqual(r, Tensor(shape: [2, 3], elements: [0.5, 0.5, 0.375, 0.25, 0.15625, 0.09375])) + XCTAssertEqual(a / b, Tensor(shape: [2, 3], elements: [1024, 128, 16, 2, 0.25, 0.03125])) + XCTAssertEqual(b / a, Tensor(shape: [2, 3], elements: [0.0009765625, 0.0078125, 0.0625, 0.5, 4, 32])) } do { From b0b52466c21178f6f717b66523c6c0ad6b0ad88b Mon Sep 17 00:00:00 2001 From: Yuta Koshizawa Date: Mon, 24 Oct 2016 19:34:52 +0900 Subject: [PATCH 19/26] Fix warnings by unused results --- Tests/TensorSwiftTests/TensorNNTests.swift | 4 ++-- Tests/TensorSwiftTests/TensorTests.swift | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Tests/TensorSwiftTests/TensorNNTests.swift b/Tests/TensorSwiftTests/TensorNNTests.swift index 658ec2c..69781b2 100644 --- a/Tests/TensorSwiftTests/TensorNNTests.swift +++ b/Tests/TensorSwiftTests/TensorNNTests.swift @@ -66,7 +66,7 @@ class TensorNNTests: XCTestCase { func testMaxPoolPerformance(){ let image = Tensor(shape: [28,28,3], element: 0.1) measure{ - image.maxPool(kernelSize: [2,2,1], strides: [2,2,1]) + _ = image.maxPool(kernelSize: [2,2,1], strides: [2,2,1]) } } @@ -74,7 +74,7 @@ class TensorNNTests: XCTestCase { let image = Tensor(shape: [28,28,1], element: 0.1) let filter = Tensor(shape: [5,5,1,16], element: 0.1) measure{ - image.conv2d(filter: filter, strides: [1,1,1]) + _ = image.conv2d(filter: filter, strides: [1,1,1]) } } diff --git a/Tests/TensorSwiftTests/TensorTests.swift b/Tests/TensorSwiftTests/TensorTests.swift index 8462901..a1df5f2 100644 --- a/Tests/TensorSwiftTests/TensorTests.swift +++ b/Tests/TensorSwiftTests/TensorTests.swift @@ -149,7 +149,7 @@ class TensorTests: XCTestCase { let a = Tensor(shape: [1000, 1000], element: 0.1) let b = Tensor(shape: [1000, 1000], element: 0.1) measure{ - a.matmul(b) + _ = a.matmul(b) } } From bdc349b3380edacf504d734011ebbeb368d594e0 Mon Sep 17 00:00:00 2001 From: Yuta Koshizawa Date: Mon, 24 Oct 2016 19:44:21 +0900 Subject: [PATCH 20/26] Change `volume` properties to methods Because they are not O(1). --- Sources/Shape.swift | 2 +- Sources/Tensor.swift | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Sources/Shape.swift b/Sources/Shape.swift index 4de9190..6621a6f 100644 --- a/Sources/Shape.swift +++ b/Sources/Shape.swift @@ -1,7 +1,7 @@ public struct Shape { public let dimensions: [Dimension] - public var volume: Int { + public func volume() -> Int { return dimensions.reduce(1) { $0 * $1.value } } diff --git a/Sources/Tensor.swift b/Sources/Tensor.swift index 61bf6e7..fcf66ca 100644 --- a/Sources/Tensor.swift +++ b/Sources/Tensor.swift @@ -10,8 +10,8 @@ public struct Tensor { public fileprivate(set) var elements: [Element] public init(shape: Shape, elements: [Element]) { - let volume = shape.volume - precondition(elements.count >= volume, "`elements.count` must be greater than or equal to `shape.volume`: elements.count = \(elements.count), shape.volume = \(shape.volume)") + let volume = shape.volume() + precondition(elements.count >= volume, "`elements.count` must be greater than or equal to `shape.volume`: elements.count = \(elements.count), shape.volume = \(shape.volume())") self.shape = shape self.elements = (elements.count == volume) ? elements : Array(elements[0.. Int { + return shape.volume() } } From ba400ee4c8b4e934712297fd216856ab3fdd95f8 Mon Sep 17 00:00:00 2001 From: Yuta Koshizawa Date: Mon, 24 Oct 2016 19:54:20 +0900 Subject: [PATCH 21/26] Change mathmatical properties to methods Because they are not O(1). --- Sources/TensorMath.swift | 30 +++++++++++++++--------------- Sources/TensorNN.swift | 2 +- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Sources/TensorMath.swift b/Sources/TensorMath.swift index 5842005..018c0c5 100644 --- a/Sources/TensorMath.swift +++ b/Sources/TensorMath.swift @@ -13,61 +13,61 @@ public func **(lhs: Tensor.Element, rhs: Tensor) -> Tensor { } extension Tensor { - public var sin: Tensor { + public func sin() -> Tensor { return Tensor(shape: shape, elements: elements.map(sinf)) } - public var cos: Tensor { + public func cos() -> Tensor { return Tensor(shape: shape, elements: elements.map(cosf)) } - public var tan: Tensor { + public func tan() -> Tensor { return Tensor(shape: shape, elements: elements.map(tanf)) } - public var asin: Tensor { + public func asin() -> Tensor { return Tensor(shape: shape, elements: elements.map(asinf)) } - public var acos: Tensor { + public func acos() -> Tensor { return Tensor(shape: shape, elements: elements.map(acosf)) } - public var atan: Tensor { + public func atan() -> Tensor { return Tensor(shape: shape, elements: elements.map(atanf)) } - public var sinh: Tensor { + public func sinh() -> Tensor { return Tensor(shape: shape, elements: elements.map(sinhf)) } - public var cosh: Tensor { + public func cosh() -> Tensor { return Tensor(shape: shape, elements: elements.map(coshf)) } - public var tanh: Tensor { + public func tanh() -> Tensor { return Tensor(shape: shape, elements: elements.map(tanhf)) } - public var exp: Tensor { + public func exp() -> Tensor { return Tensor(shape: shape, elements: elements.map(expf)) } - public var log: Tensor { + public func log() -> Tensor { return Tensor(shape: shape, elements: elements.map(logf)) } - public var sqrt: Tensor { + public func sqrt() -> Tensor { return Tensor(shape: shape, elements: elements.map(sqrtf)) } - public var cbrt: Tensor { + public func cbrt() -> Tensor { return Tensor(shape: shape, elements: elements.map(cbrtf)) } } extension Tensor { - public var sigmoid: Tensor { + public func sigmoid() -> Tensor { return Tensor(shape: shape, elements: elements.map { 1.0 / expf(-$0) }) } -} \ No newline at end of file +} diff --git a/Sources/TensorNN.swift b/Sources/TensorNN.swift index 9c0bc38..3315471 100644 --- a/Sources/TensorNN.swift +++ b/Sources/TensorNN.swift @@ -5,7 +5,7 @@ import Accelerate extension Tensor { public var softmax: Tensor { - let exps = exp + let exps = exp() let sum = exps.elements.reduce(0.0, +) return exps / sum } From 84f1eca0bee2218650d704613ed0040d2d0c10f5 Mon Sep 17 00:00:00 2001 From: Yuta Koshizawa Date: Mon, 24 Oct 2016 19:59:24 +0900 Subject: [PATCH 22/26] Change NN properties to methods Because they are not O(1). --- MNIST/Classifier.swift | 8 ++++---- Sources/TensorNN.swift | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/MNIST/Classifier.swift b/MNIST/Classifier.swift index 3618bea..6a8c053 100644 --- a/MNIST/Classifier.swift +++ b/MNIST/Classifier.swift @@ -12,16 +12,16 @@ public struct Classifier { public let b_fc2: Tensor public func classify(_ x_image: Tensor) -> Int { - let h_conv1 = (x_image.conv2d(filter: W_conv1, strides: [1, 1, 1]) + b_conv1).relu + let h_conv1 = (x_image.conv2d(filter: W_conv1, strides: [1, 1, 1]) + b_conv1).relu() let h_pool1 = h_conv1.maxPool(kernelSize: [2, 2, 1], strides: [2, 2, 1]) - let h_conv2 = (h_pool1.conv2d(filter: W_conv2, strides: [1, 1, 1]) + b_conv2).relu + let h_conv2 = (h_pool1.conv2d(filter: W_conv2, strides: [1, 1, 1]) + b_conv2).relu() let h_pool2 = h_conv2.maxPool(kernelSize: [2, 2, 1], strides: [2, 2, 1]) let h_pool2_flat = h_pool2.reshape([1, 7 * 7 * 64]) - let h_fc1 = (h_pool2_flat.matmul(W_fc1) + b_fc1).relu + let h_fc1 = (h_pool2_flat.matmul(W_fc1) + b_fc1).relu() - let y_conv = (h_fc1.matmul(W_fc2) + b_fc2).softmax + let y_conv = (h_fc1.matmul(W_fc2) + b_fc2).softmax() return y_conv.elements.enumerated().max { $0.1 < $1.1 }!.0 } diff --git a/Sources/TensorNN.swift b/Sources/TensorNN.swift index 3315471..1bc73f3 100644 --- a/Sources/TensorNN.swift +++ b/Sources/TensorNN.swift @@ -4,13 +4,13 @@ import Accelerate #endif extension Tensor { - public var softmax: Tensor { + public func softmax() -> Tensor { let exps = exp() let sum = exps.elements.reduce(0.0, +) return exps / sum } - public var relu: Tensor { + public func relu() -> Tensor { return Tensor(shape: shape, elements: elements.map { fmax($0, 0.0) }) } } From a6d92011c845f1adec3098cedae5e70caf83e7dd Mon Sep 17 00:00:00 2001 From: Yuta Koshizawa Date: Mon, 24 Oct 2016 20:07:49 +0900 Subject: [PATCH 23/26] Rename `reshape` to `reshaped` To follow the API guidelines. --- Sources/Tensor.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Tensor.swift b/Sources/Tensor.swift index fcf66ca..5569c64 100644 --- a/Sources/Tensor.swift +++ b/Sources/Tensor.swift @@ -24,7 +24,7 @@ extension Tensor { // Additional Initializers } extension Tensor { - public func reshape(_ shape: Shape) -> Tensor { + public func reshaped(_ shape: Shape) -> Tensor { return Tensor(shape: shape, elements: elements) } } From 956f5ee22f91ad698eb7bd2d210dfa41c0f8b7ae Mon Sep 17 00:00:00 2001 From: Yuta Koshizawa Date: Mon, 24 Oct 2016 20:11:05 +0900 Subject: [PATCH 24/26] Implement the new mutating `resphape` method --- MNIST/Classifier.swift | 2 +- Sources/Tensor.swift | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/MNIST/Classifier.swift b/MNIST/Classifier.swift index 6a8c053..e6ed24c 100644 --- a/MNIST/Classifier.swift +++ b/MNIST/Classifier.swift @@ -18,7 +18,7 @@ public struct Classifier { let h_conv2 = (h_pool1.conv2d(filter: W_conv2, strides: [1, 1, 1]) + b_conv2).relu() let h_pool2 = h_conv2.maxPool(kernelSize: [2, 2, 1], strides: [2, 2, 1]) - let h_pool2_flat = h_pool2.reshape([1, 7 * 7 * 64]) + let h_pool2_flat = h_pool2.reshaped([1, 7 * 7 * 64]) let h_fc1 = (h_pool2_flat.matmul(W_fc1) + b_fc1).relu() let y_conv = (h_fc1.matmul(W_fc2) + b_fc2).softmax() diff --git a/Sources/Tensor.swift b/Sources/Tensor.swift index 5569c64..d924deb 100644 --- a/Sources/Tensor.swift +++ b/Sources/Tensor.swift @@ -24,6 +24,10 @@ extension Tensor { // Additional Initializers } extension Tensor { + public mutating func reshape(_ shape: Shape) { + self = reshaped(shape) + } + public func reshaped(_ shape: Shape) -> Tensor { return Tensor(shape: shape, elements: elements) } From 54551d898dbce6530555d9c2909bd58c44db4236 Mon Sep 17 00:00:00 2001 From: Yuta Koshizawa Date: Mon, 24 Oct 2016 20:15:50 +0900 Subject: [PATCH 25/26] Update the codes in README --- README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index f5de083..f2c6a24 100644 --- a/README.md +++ b/README.md @@ -33,18 +33,18 @@ public struct Classifier { public let b_fc2: Tensor public func classify(x_image: Tensor) -> Int { - let h_conv1 = (x_image.conv2d(filter: W_conv1, strides: [1, 1, 1]) + b_conv1).relu + let h_conv1 = (x_image.conv2d(filter: W_conv1, strides: [1, 1, 1]) + b_conv1).relu() let h_pool1 = h_conv1.maxPool(kernelSize: [2, 2, 1], strides: [2, 2, 1]) - - let h_conv2 = (h_pool1.conv2d(filter: W_conv2, strides: [1, 1, 1]) + b_conv2).relu + + let h_conv2 = (h_pool1.conv2d(filter: W_conv2, strides: [1, 1, 1]) + b_conv2).relu() let h_pool2 = h_conv2.maxPool(kernelSize: [2, 2, 1], strides: [2, 2, 1]) + + let h_pool2_flat = h_pool2.reshaped([1, 7 * 7 * 64]) + let h_fc1 = (h_pool2_flat.matmul(W_fc1) + b_fc1).relu() + + let y_conv = (h_fc1.matmul(W_fc2) + b_fc2).softmax() - let h_pool2_flat = h_pool2.reshape([1, 7 * 7 * 64]) - let h_fc1 = (h_pool2_flat.matmul(W_fc1) + b_fc1).relu - - let y_conv = (h_fc1.matmul(W_fc2) + b_fc2).softmax - - return y_conv.elements.enumerate().maxElement { $0.1 < $1.1 }!.0 + return y_conv.elements.enumerated().max { $0.1 < $1.1 }!.0 } } ``` From e2c0e9e7fbf208d1cd809c961fdf7e2abf22acef Mon Sep 17 00:00:00 2001 From: Yuta Koshizawa Date: Mon, 24 Oct 2016 20:16:18 +0900 Subject: [PATCH 26/26] Update versions in README --- README.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index f2c6a24..724dada 100644 --- a/README.md +++ b/README.md @@ -51,22 +51,23 @@ public struct Classifier { ## Installation -### CocoaPods +### Swift Package Manager ``` -pod 'TensorSwift', '~> 0.1' +.Package(url: "git@github.com:qoncept/TensorSwift.git", + Version(0, 2, 0)), ``` -### Carthage +### CocoaPods ``` -github "qoncept/TensorSwift" ~> 0.1 +pod 'TensorSwift', '~> 0.2' ``` -### Swift Package Manager +### Carthage + ``` -.Package(url: "git@github.com:qoncept/TensorSwift.git", - Version(0, 2, 0, prereleaseIdentifiers: ["beta"])), +github "qoncept/TensorSwift" ~> 0.2 ``` ## License