From 997c451fd9a743ae596d7425c3bf8b2885475f5c Mon Sep 17 00:00:00 2001 From: Yuta Koshizawa Date: Mon, 23 Oct 2017 17:51:10 +0900 Subject: [PATCH 1/8] Update for swift-tools-version:4.0 --- MNIST/Classifier.swift | 4 +- Package.swift | 25 ++++++- Sources/{ => TensorSwift}/Dimension.swift | 0 Sources/{ => TensorSwift}/Info.plist | 0 Sources/{ => TensorSwift}/Operators.swift | 0 Sources/{ => TensorSwift}/Shape.swift | 0 Sources/{ => TensorSwift}/Tensor.swift | 0 Sources/{ => TensorSwift}/TensorMath.swift | 0 Sources/{ => TensorSwift}/TensorNN.swift | 0 Sources/{ => TensorSwift}/TensorSwift.h | 0 Sources/{ => TensorSwift}/Utils.swift | 0 TensorSwift.xcodeproj/project.pbxproj | 83 ++++++++++++---------- 12 files changed, 72 insertions(+), 40 deletions(-) rename Sources/{ => TensorSwift}/Dimension.swift (100%) rename Sources/{ => TensorSwift}/Info.plist (100%) rename Sources/{ => TensorSwift}/Operators.swift (100%) rename Sources/{ => TensorSwift}/Shape.swift (100%) rename Sources/{ => TensorSwift}/Tensor.swift (100%) rename Sources/{ => TensorSwift}/TensorMath.swift (100%) rename Sources/{ => TensorSwift}/TensorNN.swift (100%) rename Sources/{ => TensorSwift}/TensorSwift.h (100%) rename Sources/{ => TensorSwift}/Utils.swift (100%) diff --git a/MNIST/Classifier.swift b/MNIST/Classifier.swift index e6ed24c..d3661fb 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.reshaped([1, 7 * 7 * 64]) + let h_pool2_flat = h_pool2.reshaped([1, 7 * 7 * Dimension(64)]) let h_fc1 = (h_pool2_flat.matmul(W_fc1) + b_fc1).relu() let y_conv = (h_fc1.matmul(W_fc2) + b_fc2).softmax() @@ -33,7 +33,7 @@ extension Classifier { 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")) + W_fc1 = Tensor(shape: [7 * 7 * Dimension(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")) diff --git a/Package.swift b/Package.swift index be3ad23..5d06451 100644 --- a/Package.swift +++ b/Package.swift @@ -1,5 +1,28 @@ +// swift-tools-version:4.0 +// The swift-tools-version declares the minimum version of Swift required to build this package. + import PackageDescription let package = Package( - name: "TensorSwift" + name: "TensorSwift", + products: [ + // Products define the executables and libraries produced by a package, and make them visible to other packages. + .library( + name: "TensorSwift", + targets: ["TensorSwift"]), + ], + dependencies: [ + // Dependencies declare other packages that this package depends on. + // .package(url: /* package url */, from: "1.0.0"), + ], + targets: [ + // Targets are the basic building blocks of a package. A target can define a module or a test suite. + // Targets can depend on other targets in this package, and on products in packages which this package depends on. + .target( + name: "TensorSwift", + dependencies: []), + .testTarget( + name: "TensorSwiftTests", + dependencies: ["TensorSwift"]), + ] ) diff --git a/Sources/Dimension.swift b/Sources/TensorSwift/Dimension.swift similarity index 100% rename from Sources/Dimension.swift rename to Sources/TensorSwift/Dimension.swift diff --git a/Sources/Info.plist b/Sources/TensorSwift/Info.plist similarity index 100% rename from Sources/Info.plist rename to Sources/TensorSwift/Info.plist diff --git a/Sources/Operators.swift b/Sources/TensorSwift/Operators.swift similarity index 100% rename from Sources/Operators.swift rename to Sources/TensorSwift/Operators.swift diff --git a/Sources/Shape.swift b/Sources/TensorSwift/Shape.swift similarity index 100% rename from Sources/Shape.swift rename to Sources/TensorSwift/Shape.swift diff --git a/Sources/Tensor.swift b/Sources/TensorSwift/Tensor.swift similarity index 100% rename from Sources/Tensor.swift rename to Sources/TensorSwift/Tensor.swift diff --git a/Sources/TensorMath.swift b/Sources/TensorSwift/TensorMath.swift similarity index 100% rename from Sources/TensorMath.swift rename to Sources/TensorSwift/TensorMath.swift diff --git a/Sources/TensorNN.swift b/Sources/TensorSwift/TensorNN.swift similarity index 100% rename from Sources/TensorNN.swift rename to Sources/TensorSwift/TensorNN.swift diff --git a/Sources/TensorSwift.h b/Sources/TensorSwift/TensorSwift.h similarity index 100% rename from Sources/TensorSwift.h rename to Sources/TensorSwift/TensorSwift.h diff --git a/Sources/Utils.swift b/Sources/TensorSwift/Utils.swift similarity index 100% rename from Sources/Utils.swift rename to Sources/TensorSwift/Utils.swift diff --git a/TensorSwift.xcodeproj/project.pbxproj b/TensorSwift.xcodeproj/project.pbxproj index c8db367..f0e9650 100644 --- a/TensorSwift.xcodeproj/project.pbxproj +++ b/TensorSwift.xcodeproj/project.pbxproj @@ -43,14 +43,14 @@ 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 */; }; + D66840171F9DDD7500D1DE7F /* Dimension.swift in Sources */ = {isa = PBXBuildFile; fileRef = D668400E1F9DDD7500D1DE7F /* Dimension.swift */; }; + D66840181F9DDD7500D1DE7F /* Operators.swift in Sources */ = {isa = PBXBuildFile; fileRef = D66840101F9DDD7500D1DE7F /* Operators.swift */; }; + D66840191F9DDD7500D1DE7F /* Shape.swift in Sources */ = {isa = PBXBuildFile; fileRef = D66840111F9DDD7500D1DE7F /* Shape.swift */; }; + D668401A1F9DDD7500D1DE7F /* Tensor.swift in Sources */ = {isa = PBXBuildFile; fileRef = D66840121F9DDD7500D1DE7F /* Tensor.swift */; }; + D668401B1F9DDD7500D1DE7F /* TensorMath.swift in Sources */ = {isa = PBXBuildFile; fileRef = D66840131F9DDD7500D1DE7F /* TensorMath.swift */; }; + D668401C1F9DDD7500D1DE7F /* TensorNN.swift in Sources */ = {isa = PBXBuildFile; fileRef = D66840141F9DDD7500D1DE7F /* TensorNN.swift */; }; + D668401D1F9DDD7500D1DE7F /* Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = D66840161F9DDD7500D1DE7F /* Utils.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 */; }; - __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 */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -140,15 +140,17 @@ 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 = ""; }; + D668400E1F9DDD7500D1DE7F /* Dimension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Dimension.swift; sourceTree = ""; }; + D668400F1F9DDD7500D1DE7F /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + D66840101F9DDD7500D1DE7F /* Operators.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Operators.swift; sourceTree = ""; }; + D66840111F9DDD7500D1DE7F /* Shape.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Shape.swift; sourceTree = ""; }; + D66840121F9DDD7500D1DE7F /* Tensor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Tensor.swift; sourceTree = ""; }; + D66840131F9DDD7500D1DE7F /* TensorMath.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TensorMath.swift; sourceTree = ""; }; + D66840141F9DDD7500D1DE7F /* TensorNN.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TensorNN.swift; sourceTree = ""; }; + D66840151F9DDD7500D1DE7F /* TensorSwift.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TensorSwift.h; sourceTree = ""; }; + D66840161F9DDD7500D1DE7F /* Utils.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Utils.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 = ""; }; - __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 = ""; }; "_____Product_TensorSwift" /* TensorSwift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = TensorSwift.framework; sourceTree = BUILT_PRODUCTS_DIR; }; "_____Product_TensorSwiftTests" /* TensorSwiftTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; path = TensorSwiftTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -262,6 +264,23 @@ name = Frameworks; sourceTree = ""; }; + D668400D1F9DDD7500D1DE7F /* TensorSwift */ = { + isa = PBXGroup; + children = ( + D668400E1F9DDD7500D1DE7F /* Dimension.swift */, + D668400F1F9DDD7500D1DE7F /* Info.plist */, + D66840101F9DDD7500D1DE7F /* Operators.swift */, + D66840111F9DDD7500D1DE7F /* Shape.swift */, + D66840121F9DDD7500D1DE7F /* Tensor.swift */, + D66840131F9DDD7500D1DE7F /* TensorMath.swift */, + D66840141F9DDD7500D1DE7F /* TensorNN.swift */, + D66840151F9DDD7500D1DE7F /* TensorSwift.h */, + D66840161F9DDD7500D1DE7F /* Utils.swift */, + ); + name = TensorSwift; + path = Sources/TensorSwift; + sourceTree = ""; + }; TestProducts_ /* Tests */ = { isa = PBXGroup; children = ( @@ -309,26 +328,11 @@ "_____Sources_" /* Sources */ = { isa = PBXGroup; children = ( - "_______Group_TensorSwift" /* TensorSwift */, + D668400D1F9DDD7500D1DE7F /* TensorSwift */, ); name = Sources; sourceTree = ""; }; - "_______Group_TensorSwift" /* TensorSwift */ = { - isa = PBXGroup; - children = ( - __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 = ""; - }; "_______Group_TensorSwiftTests" /* TensorSwiftTests */ = { isa = PBXGroup; children = ( @@ -572,13 +576,13 @@ isa = PBXSourcesBuildPhase; buildActionMask = 0; files = ( - __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 */, + D66840171F9DDD7500D1DE7F /* Dimension.swift in Sources */, + D66840191F9DDD7500D1DE7F /* Shape.swift in Sources */, + D668401C1F9DDD7500D1DE7F /* TensorNN.swift in Sources */, + D668401D1F9DDD7500D1DE7F /* Utils.swift in Sources */, + D668401A1F9DDD7500D1DE7F /* Tensor.swift in Sources */, + D66840181F9DDD7500D1DE7F /* Operators.swift in Sources */, + D668401B1F9DDD7500D1DE7F /* TensorMath.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -990,6 +994,7 @@ _ReleaseConf_TensorSwiftTests /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CLANG_ENABLE_MODULES = YES; EMBEDDED_CONTENT_CONTAINS_SWIFT = YES; FRAMEWORK_SEARCH_PATHS = "$(PLATFORM_DIR)/Developer/Library/Frameworks"; @@ -1023,6 +1028,7 @@ "___DebugConf_TensorSwiftTests" /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CLANG_ENABLE_MODULES = YES; EMBEDDED_CONTENT_CONTAINS_SWIFT = YES; FRAMEWORK_SEARCH_PATHS = "$(PLATFORM_DIR)/Developer/Library/Frameworks"; @@ -1059,6 +1065,7 @@ A7C387CC1D9F604A00091506 /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Debug; }; A7C387D21D9F604A00091506 /* Build configuration list for PBXNativeTarget "MNISTTests" */ = { isa = XCConfigurationList; @@ -1067,6 +1074,7 @@ A7C387CE1D9F604A00091506 /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Debug; }; A7C387D31D9F604A00091506 /* Build configuration list for PBXNativeTarget "MNISTUITests" */ = { isa = XCConfigurationList; @@ -1075,6 +1083,7 @@ A7C387D01D9F604A00091506 /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Debug; }; "___RootConfs_" /* Build configuration list for PBXProject "TensorSwift" */ = { isa = XCConfigurationList; From 4642c5436abb819e4c1ddfdf5c7bb9fc3b115151 Mon Sep 17 00:00:00 2001 From: Yuta Koshizawa Date: Mon, 23 Oct 2017 18:21:16 +0900 Subject: [PATCH 2/8] Move MNIST and MNISTTests --- MNISTTests/MNISTTests.swift | 16 - MNISTUITests/Info.plist | 22 - MNISTUITests/MNISTUITests.swift | 36 -- {MNIST => Sources/MNIST}/AppDelegate.swift | 0 .../AppIcon.appiconset/Contents.json | 0 .../MNIST}/Base.lproj/LaunchScreen.storyboard | 0 .../MNIST}/Base.lproj/Main.storyboard | 0 {MNIST => Sources/MNIST}/Canvas.swift | 0 {MNIST => Sources/MNIST}/CanvasView.swift | 0 {MNIST => Sources/MNIST}/Classifier.swift | 0 {MNIST => Sources/MNIST}/Info.plist | 0 {MNIST => Sources/MNIST}/Line.swift | 0 {MNIST => Sources/MNIST}/Models/W_conv1 | Bin {MNIST => Sources/MNIST}/Models/W_conv2 | Bin {MNIST => Sources/MNIST}/Models/W_fc1 | Bin {MNIST => Sources/MNIST}/Models/W_fc2 | Bin {MNIST => Sources/MNIST}/Models/b_conv1 | 0 {MNIST => Sources/MNIST}/Models/b_conv2 | 0 {MNIST => Sources/MNIST}/Models/b_fc1 | Bin {MNIST => Sources/MNIST}/Models/b_fc2 | 0 {MNIST => Sources/MNIST}/String.swift | 0 {MNIST => Sources/MNIST}/ViewController.swift | 0 TensorSwift.xcodeproj/project.pbxproj | 464 +++++------------- {MNISTTests => Tests/MNISTTests}/Array.swift | 0 .../MNISTTests}/ClassifierTests.swift | 0 .../MNISTTests}/Downloader.swift | 0 .../MNISTTests}/DownloaderTests.swift | 0 {MNISTTests => Tests/MNISTTests}/Info.plist | 0 .../MNISTTests}/MNISTTests-Bridging-Header.h | 0 {MNISTTests => Tests/MNISTTests}/SHA1.swift | 0 30 files changed, 136 insertions(+), 402 deletions(-) delete mode 100644 MNISTTests/MNISTTests.swift delete mode 100644 MNISTUITests/Info.plist delete mode 100644 MNISTUITests/MNISTUITests.swift rename {MNIST => Sources/MNIST}/AppDelegate.swift (100%) rename {MNIST => Sources/MNIST}/Assets.xcassets/AppIcon.appiconset/Contents.json (100%) rename {MNIST => Sources/MNIST}/Base.lproj/LaunchScreen.storyboard (100%) rename {MNIST => Sources/MNIST}/Base.lproj/Main.storyboard (100%) rename {MNIST => Sources/MNIST}/Canvas.swift (100%) rename {MNIST => Sources/MNIST}/CanvasView.swift (100%) rename {MNIST => Sources/MNIST}/Classifier.swift (100%) rename {MNIST => Sources/MNIST}/Info.plist (100%) rename {MNIST => Sources/MNIST}/Line.swift (100%) rename {MNIST => Sources/MNIST}/Models/W_conv1 (100%) rename {MNIST => Sources/MNIST}/Models/W_conv2 (100%) rename {MNIST => Sources/MNIST}/Models/W_fc1 (100%) rename {MNIST => Sources/MNIST}/Models/W_fc2 (100%) rename {MNIST => Sources/MNIST}/Models/b_conv1 (100%) rename {MNIST => Sources/MNIST}/Models/b_conv2 (100%) rename {MNIST => Sources/MNIST}/Models/b_fc1 (100%) rename {MNIST => Sources/MNIST}/Models/b_fc2 (100%) rename {MNIST => Sources/MNIST}/String.swift (100%) rename {MNIST => Sources/MNIST}/ViewController.swift (100%) rename {MNISTTests => Tests/MNISTTests}/Array.swift (100%) rename {MNISTTests => Tests/MNISTTests}/ClassifierTests.swift (100%) rename {MNISTTests => Tests/MNISTTests}/Downloader.swift (100%) rename {MNISTTests => Tests/MNISTTests}/DownloaderTests.swift (100%) rename {MNISTTests => Tests/MNISTTests}/Info.plist (100%) rename {MNISTTests => Tests/MNISTTests}/MNISTTests-Bridging-Header.h (100%) rename {MNISTTests => Tests/MNISTTests}/SHA1.swift (100%) diff --git a/MNISTTests/MNISTTests.swift b/MNISTTests/MNISTTests.swift deleted file mode 100644 index 860d337..0000000 --- a/MNISTTests/MNISTTests.swift +++ /dev/null @@ -1,16 +0,0 @@ -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/MNISTUITests/Info.plist b/MNISTUITests/Info.plist deleted file mode 100644 index 6c6c23c..0000000 --- a/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/MNISTUITests/MNISTUITests.swift b/MNISTUITests/MNISTUITests.swift deleted file mode 100644 index 25c2ef8..0000000 --- a/MNISTUITests/MNISTUITests.swift +++ /dev/null @@ -1,36 +0,0 @@ -// -// 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/MNIST/AppDelegate.swift b/Sources/MNIST/AppDelegate.swift similarity index 100% rename from MNIST/AppDelegate.swift rename to Sources/MNIST/AppDelegate.swift diff --git a/MNIST/Assets.xcassets/AppIcon.appiconset/Contents.json b/Sources/MNIST/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from MNIST/Assets.xcassets/AppIcon.appiconset/Contents.json rename to Sources/MNIST/Assets.xcassets/AppIcon.appiconset/Contents.json diff --git a/MNIST/Base.lproj/LaunchScreen.storyboard b/Sources/MNIST/Base.lproj/LaunchScreen.storyboard similarity index 100% rename from MNIST/Base.lproj/LaunchScreen.storyboard rename to Sources/MNIST/Base.lproj/LaunchScreen.storyboard diff --git a/MNIST/Base.lproj/Main.storyboard b/Sources/MNIST/Base.lproj/Main.storyboard similarity index 100% rename from MNIST/Base.lproj/Main.storyboard rename to Sources/MNIST/Base.lproj/Main.storyboard diff --git a/MNIST/Canvas.swift b/Sources/MNIST/Canvas.swift similarity index 100% rename from MNIST/Canvas.swift rename to Sources/MNIST/Canvas.swift diff --git a/MNIST/CanvasView.swift b/Sources/MNIST/CanvasView.swift similarity index 100% rename from MNIST/CanvasView.swift rename to Sources/MNIST/CanvasView.swift diff --git a/MNIST/Classifier.swift b/Sources/MNIST/Classifier.swift similarity index 100% rename from MNIST/Classifier.swift rename to Sources/MNIST/Classifier.swift diff --git a/MNIST/Info.plist b/Sources/MNIST/Info.plist similarity index 100% rename from MNIST/Info.plist rename to Sources/MNIST/Info.plist diff --git a/MNIST/Line.swift b/Sources/MNIST/Line.swift similarity index 100% rename from MNIST/Line.swift rename to Sources/MNIST/Line.swift diff --git a/MNIST/Models/W_conv1 b/Sources/MNIST/Models/W_conv1 similarity index 100% rename from MNIST/Models/W_conv1 rename to Sources/MNIST/Models/W_conv1 diff --git a/MNIST/Models/W_conv2 b/Sources/MNIST/Models/W_conv2 similarity index 100% rename from MNIST/Models/W_conv2 rename to Sources/MNIST/Models/W_conv2 diff --git a/MNIST/Models/W_fc1 b/Sources/MNIST/Models/W_fc1 similarity index 100% rename from MNIST/Models/W_fc1 rename to Sources/MNIST/Models/W_fc1 diff --git a/MNIST/Models/W_fc2 b/Sources/MNIST/Models/W_fc2 similarity index 100% rename from MNIST/Models/W_fc2 rename to Sources/MNIST/Models/W_fc2 diff --git a/MNIST/Models/b_conv1 b/Sources/MNIST/Models/b_conv1 similarity index 100% rename from MNIST/Models/b_conv1 rename to Sources/MNIST/Models/b_conv1 diff --git a/MNIST/Models/b_conv2 b/Sources/MNIST/Models/b_conv2 similarity index 100% rename from MNIST/Models/b_conv2 rename to Sources/MNIST/Models/b_conv2 diff --git a/MNIST/Models/b_fc1 b/Sources/MNIST/Models/b_fc1 similarity index 100% rename from MNIST/Models/b_fc1 rename to Sources/MNIST/Models/b_fc1 diff --git a/MNIST/Models/b_fc2 b/Sources/MNIST/Models/b_fc2 similarity index 100% rename from MNIST/Models/b_fc2 rename to Sources/MNIST/Models/b_fc2 diff --git a/MNIST/String.swift b/Sources/MNIST/String.swift similarity index 100% rename from MNIST/String.swift rename to Sources/MNIST/String.swift diff --git a/MNIST/ViewController.swift b/Sources/MNIST/ViewController.swift similarity index 100% rename from MNIST/ViewController.swift rename to Sources/MNIST/ViewController.swift diff --git a/TensorSwift.xcodeproj/project.pbxproj b/TensorSwift.xcodeproj/project.pbxproj index f0e9650..edd04af 100644 --- a/TensorSwift.xcodeproj/project.pbxproj +++ b/TensorSwift.xcodeproj/project.pbxproj @@ -14,33 +14,8 @@ 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 /* ClassifierTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7C387E41D9F614E00091506 /* ClassifierTests.swift */; }; - A7C387EB1D9F614E00091506 /* Downloader.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7C387E51D9F614E00091506 /* Downloader.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 */; }; - 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 */; }; D646CEF61DBE1A25003E8A59 /* TensorMathTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = D646CEF51DBE1A25003E8A59 /* TensorMathTest.swift */; }; D66840171F9DDD7500D1DE7F /* Dimension.swift in Sources */ = {isa = PBXBuildFile; fileRef = D668400E1F9DDD7500D1DE7F /* Dimension.swift */; }; @@ -50,6 +25,29 @@ D668401B1F9DDD7500D1DE7F /* TensorMath.swift in Sources */ = {isa = PBXBuildFile; fileRef = D66840131F9DDD7500D1DE7F /* TensorMath.swift */; }; D668401C1F9DDD7500D1DE7F /* TensorNN.swift in Sources */ = {isa = PBXBuildFile; fileRef = D66840141F9DDD7500D1DE7F /* TensorNN.swift */; }; D668401D1F9DDD7500D1DE7F /* Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = D66840161F9DDD7500D1DE7F /* Utils.swift */; }; + D66840271F9DE8DF00D1DE7F /* Array.swift in Sources */ = {isa = PBXBuildFile; fileRef = D668401F1F9DE8DF00D1DE7F /* Array.swift */; }; + D66840281F9DE8DF00D1DE7F /* ClassifierTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D66840201F9DE8DF00D1DE7F /* ClassifierTests.swift */; }; + D66840291F9DE8DF00D1DE7F /* Downloader.swift in Sources */ = {isa = PBXBuildFile; fileRef = D66840211F9DE8DF00D1DE7F /* Downloader.swift */; }; + D668402A1F9DE8DF00D1DE7F /* DownloaderTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D66840221F9DE8DF00D1DE7F /* DownloaderTests.swift */; }; + D668402D1F9DE8DF00D1DE7F /* SHA1.swift in Sources */ = {isa = PBXBuildFile; fileRef = D66840261F9DE8DF00D1DE7F /* SHA1.swift */; }; + D66840451F9DE8F000D1DE7F /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D668402F1F9DE8F000D1DE7F /* AppDelegate.swift */; }; + D66840461F9DE8F000D1DE7F /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D66840301F9DE8F000D1DE7F /* Assets.xcassets */; }; + D66840471F9DE8F000D1DE7F /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D66840311F9DE8F000D1DE7F /* LaunchScreen.storyboard */; }; + D66840481F9DE8F000D1DE7F /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D66840331F9DE8F000D1DE7F /* Main.storyboard */; }; + D66840491F9DE8F000D1DE7F /* Canvas.swift in Sources */ = {isa = PBXBuildFile; fileRef = D66840351F9DE8F000D1DE7F /* Canvas.swift */; }; + D668404A1F9DE8F000D1DE7F /* CanvasView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D66840361F9DE8F000D1DE7F /* CanvasView.swift */; }; + D668404B1F9DE8F000D1DE7F /* Classifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = D66840371F9DE8F000D1DE7F /* Classifier.swift */; }; + D668404D1F9DE8F000D1DE7F /* Line.swift in Sources */ = {isa = PBXBuildFile; fileRef = D66840391F9DE8F000D1DE7F /* Line.swift */; }; + D668404E1F9DE8F000D1DE7F /* b_conv1 in Resources */ = {isa = PBXBuildFile; fileRef = D668403B1F9DE8F000D1DE7F /* b_conv1 */; }; + D668404F1F9DE8F000D1DE7F /* b_conv2 in Resources */ = {isa = PBXBuildFile; fileRef = D668403C1F9DE8F000D1DE7F /* b_conv2 */; }; + D66840501F9DE8F000D1DE7F /* b_fc1 in Resources */ = {isa = PBXBuildFile; fileRef = D668403D1F9DE8F000D1DE7F /* b_fc1 */; }; + D66840511F9DE8F000D1DE7F /* b_fc2 in Resources */ = {isa = PBXBuildFile; fileRef = D668403E1F9DE8F000D1DE7F /* b_fc2 */; }; + D66840521F9DE8F000D1DE7F /* W_conv1 in Resources */ = {isa = PBXBuildFile; fileRef = D668403F1F9DE8F000D1DE7F /* W_conv1 */; }; + D66840531F9DE8F000D1DE7F /* W_conv2 in Resources */ = {isa = PBXBuildFile; fileRef = D66840401F9DE8F000D1DE7F /* W_conv2 */; }; + D66840541F9DE8F000D1DE7F /* W_fc1 in Resources */ = {isa = PBXBuildFile; fileRef = D66840411F9DE8F000D1DE7F /* W_fc1 */; }; + D66840551F9DE8F000D1DE7F /* W_fc2 in Resources */ = {isa = PBXBuildFile; fileRef = D66840421F9DE8F000D1DE7F /* W_fc2 */; }; + D66840561F9DE8F000D1DE7F /* String.swift in Sources */ = {isa = PBXBuildFile; fileRef = D66840431F9DE8F000D1DE7F /* String.swift */; }; + D66840571F9DE8F000D1DE7F /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D66840441F9DE8F000D1DE7F /* ViewController.swift */; }; _LinkFileRef_TensorSwift_via_TensorSwiftTests /* TensorSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = "_____Product_TensorSwift" /* TensorSwift.framework */; }; /* End PBXBuildFile section */ @@ -61,13 +59,6 @@ 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 */; @@ -100,37 +91,7 @@ /* 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 /* 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 /* 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 = ""; }; - 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 = ""; }; @@ -149,6 +110,32 @@ D66840141F9DDD7500D1DE7F /* TensorNN.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TensorNN.swift; sourceTree = ""; }; D66840151F9DDD7500D1DE7F /* TensorSwift.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TensorSwift.h; sourceTree = ""; }; D66840161F9DDD7500D1DE7F /* Utils.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Utils.swift; sourceTree = ""; }; + D668401F1F9DE8DF00D1DE7F /* Array.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Array.swift; sourceTree = ""; }; + D66840201F9DE8DF00D1DE7F /* ClassifierTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ClassifierTests.swift; sourceTree = ""; }; + D66840211F9DE8DF00D1DE7F /* Downloader.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Downloader.swift; sourceTree = ""; }; + D66840221F9DE8DF00D1DE7F /* DownloaderTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DownloaderTests.swift; sourceTree = ""; }; + D66840231F9DE8DF00D1DE7F /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + D66840241F9DE8DF00D1DE7F /* MNISTTests-Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MNISTTests-Bridging-Header.h"; sourceTree = ""; }; + D66840261F9DE8DF00D1DE7F /* SHA1.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SHA1.swift; sourceTree = ""; }; + D668402F1F9DE8F000D1DE7F /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + D66840301F9DE8F000D1DE7F /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + D66840321F9DE8F000D1DE7F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + D66840341F9DE8F000D1DE7F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + D66840351F9DE8F000D1DE7F /* Canvas.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Canvas.swift; sourceTree = ""; }; + D66840361F9DE8F000D1DE7F /* CanvasView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CanvasView.swift; sourceTree = ""; }; + D66840371F9DE8F000D1DE7F /* Classifier.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Classifier.swift; sourceTree = ""; }; + D66840381F9DE8F000D1DE7F /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + D66840391F9DE8F000D1DE7F /* Line.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Line.swift; sourceTree = ""; }; + D668403B1F9DE8F000D1DE7F /* b_conv1 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = b_conv1; sourceTree = ""; }; + D668403C1F9DE8F000D1DE7F /* b_conv2 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = b_conv2; sourceTree = ""; }; + D668403D1F9DE8F000D1DE7F /* b_fc1 */ = {isa = PBXFileReference; lastKnownFileType = file; path = b_fc1; sourceTree = ""; }; + D668403E1F9DE8F000D1DE7F /* b_fc2 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = b_fc2; sourceTree = ""; }; + D668403F1F9DE8F000D1DE7F /* W_conv1 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = W_conv1; sourceTree = ""; }; + D66840401F9DE8F000D1DE7F /* W_conv2 */ = {isa = PBXFileReference; lastKnownFileType = file; path = W_conv2; sourceTree = ""; }; + D66840411F9DE8F000D1DE7F /* W_fc1 */ = {isa = PBXFileReference; lastKnownFileType = file; path = W_fc1; sourceTree = ""; }; + D66840421F9DE8F000D1DE7F /* W_fc2 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = W_fc2; sourceTree = ""; }; + D66840431F9DE8F000D1DE7F /* String.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = String.swift; sourceTree = ""; }; + D66840441F9DE8F000D1DE7F /* ViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ViewController.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_TensorSwift.xcodeproj/Configs/Project.xcconfig /* TensorSwift.xcodeproj/Configs/Project.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = TensorSwift.xcodeproj/Configs/Project.xcconfig; sourceTree = ""; }; @@ -173,13 +160,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - A7C387C11D9F604A00091506 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; "___LinkPhase_TensorSwift" /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 0; @@ -198,64 +178,6 @@ /* 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 /* DownloaderTests.swift */, - A7C387E31D9F614E00091506 /* Array.swift */, - A7C387E81D9F614E00091506 /* SHA1.swift */, - A7C387E41D9F614E00091506 /* ClassifierTests.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 = ( @@ -281,6 +203,56 @@ path = Sources/TensorSwift; sourceTree = ""; }; + D668401E1F9DE8DF00D1DE7F /* MNISTTests */ = { + isa = PBXGroup; + children = ( + D668401F1F9DE8DF00D1DE7F /* Array.swift */, + D66840201F9DE8DF00D1DE7F /* ClassifierTests.swift */, + D66840211F9DE8DF00D1DE7F /* Downloader.swift */, + D66840221F9DE8DF00D1DE7F /* DownloaderTests.swift */, + D66840231F9DE8DF00D1DE7F /* Info.plist */, + D66840241F9DE8DF00D1DE7F /* MNISTTests-Bridging-Header.h */, + D66840261F9DE8DF00D1DE7F /* SHA1.swift */, + ); + name = MNISTTests; + path = Tests/MNISTTests; + sourceTree = ""; + }; + D668402E1F9DE8F000D1DE7F /* MNIST */ = { + isa = PBXGroup; + children = ( + D668402F1F9DE8F000D1DE7F /* AppDelegate.swift */, + D66840301F9DE8F000D1DE7F /* Assets.xcassets */, + D66840311F9DE8F000D1DE7F /* LaunchScreen.storyboard */, + D66840331F9DE8F000D1DE7F /* Main.storyboard */, + D66840351F9DE8F000D1DE7F /* Canvas.swift */, + D66840361F9DE8F000D1DE7F /* CanvasView.swift */, + D66840371F9DE8F000D1DE7F /* Classifier.swift */, + D66840381F9DE8F000D1DE7F /* Info.plist */, + D66840391F9DE8F000D1DE7F /* Line.swift */, + D668403A1F9DE8F000D1DE7F /* Models */, + D66840431F9DE8F000D1DE7F /* String.swift */, + D66840441F9DE8F000D1DE7F /* ViewController.swift */, + ); + name = MNIST; + path = Sources/MNIST; + sourceTree = ""; + }; + D668403A1F9DE8F000D1DE7F /* Models */ = { + isa = PBXGroup; + children = ( + D668403B1F9DE8F000D1DE7F /* b_conv1 */, + D668403C1F9DE8F000D1DE7F /* b_conv2 */, + D668403D1F9DE8F000D1DE7F /* b_fc1 */, + D668403E1F9DE8F000D1DE7F /* b_fc2 */, + D668403F1F9DE8F000D1DE7F /* W_conv1 */, + D66840401F9DE8F000D1DE7F /* W_conv2 */, + D66840411F9DE8F000D1DE7F /* W_fc1 */, + D66840421F9DE8F000D1DE7F /* W_fc2 */, + ); + path = Models; + sourceTree = ""; + }; TestProducts_ /* Tests */ = { isa = PBXGroup; children = ( @@ -297,9 +269,6 @@ "_____Sources_" /* Sources */, __PBXFileRef_Resources /* Resources */, "_______Tests_" /* Tests */, - A7C387A71D9F604900091506 /* MNIST */, - A7C387BC1D9F604900091506 /* MNISTTests */, - A7C387C71D9F604A00091506 /* MNISTUITests */, "____Products_" /* Products */, A7C387FF1D9F619000091506 /* Frameworks */, ); @@ -312,7 +281,6 @@ "_____Product_TensorSwift" /* TensorSwift.framework */, A7C387A61D9F604900091506 /* MNIST.app */, A7C387B91D9F604900091506 /* MNISTTests.xctest */, - A7C387C41D9F604A00091506 /* MNISTUITests.xctest */, ); name = Products; sourceTree = ""; @@ -329,6 +297,7 @@ isa = PBXGroup; children = ( D668400D1F9DDD7500D1DE7F /* TensorSwift */, + D668402E1F9DE8F000D1DE7F /* MNIST */, ); name = Sources; sourceTree = ""; @@ -353,6 +322,7 @@ isa = PBXGroup; children = ( "_______Group_TensorSwiftTests" /* TensorSwiftTests */, + D668401E1F9DE8DF00D1DE7F /* MNISTTests */, ); name = Tests; sourceTree = ""; @@ -397,24 +367,6 @@ 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" */; @@ -468,12 +420,6 @@ ProvisioningStyle = Automatic; TestTargetID = A7C387A51D9F604900091506; }; - A7C387C31D9F604A00091506 = { - CreatedOnToolsVersion = 8.0; - DevelopmentTeam = 3B8C483UAP; - ProvisioningStyle = Automatic; - TestTargetID = A7C387A51D9F604900091506; - }; "______Target_TensorSwiftTests" = { LastSwiftMigration = 0800; }; @@ -496,7 +442,6 @@ "______Target_TensorSwiftTests" /* TensorSwiftTests */, A7C387A51D9F604900091506 /* MNIST */, A7C387B81D9F604900091506 /* MNISTTests */, - A7C387C31D9F604A00091506 /* MNISTUITests */, ); }; /* End PBXProject section */ @@ -506,17 +451,17 @@ 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 */, + D66840541F9DE8F000D1DE7F /* W_fc1 in Resources */, + D66840521F9DE8F000D1DE7F /* W_conv1 in Resources */, + D668404F1F9DE8F000D1DE7F /* b_conv2 in Resources */, + D66840511F9DE8F000D1DE7F /* b_fc2 in Resources */, + D668404E1F9DE8F000D1DE7F /* b_conv1 in Resources */, + D66840551F9DE8F000D1DE7F /* W_fc2 in Resources */, + D66840501F9DE8F000D1DE7F /* b_fc1 in Resources */, + D66840481F9DE8F000D1DE7F /* Main.storyboard in Resources */, + D66840461F9DE8F000D1DE7F /* Assets.xcassets in Resources */, + D66840471F9DE8F000D1DE7F /* LaunchScreen.storyboard in Resources */, + D66840531F9DE8F000D1DE7F /* W_conv2 in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -527,13 +472,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - A7C387C21D9F604A00091506 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -541,13 +479,13 @@ 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 */, + D66840561F9DE8F000D1DE7F /* String.swift in Sources */, + D668404B1F9DE8F000D1DE7F /* Classifier.swift in Sources */, + D66840451F9DE8F000D1DE7F /* AppDelegate.swift in Sources */, + D66840491F9DE8F000D1DE7F /* Canvas.swift in Sources */, + D66840571F9DE8F000D1DE7F /* ViewController.swift in Sources */, + D668404A1F9DE8F000D1DE7F /* CanvasView.swift in Sources */, + D668404D1F9DE8F000D1DE7F /* Line.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -555,20 +493,11 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - A7C387BE1D9F604900091506 /* MNISTTests.swift in Sources */, - A7C387EC1D9F614F00091506 /* DownloaderTests.swift in Sources */, - A7C387ED1D9F614F00091506 /* SHA1.swift in Sources */, - A7C387E91D9F614E00091506 /* Array.swift in Sources */, - A7C387EB1D9F614E00091506 /* Downloader.swift in Sources */, - A7C387EA1D9F614E00091506 /* ClassifierTests.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - A7C387C01D9F604A00091506 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - A7C387C91D9F604A00091506 /* MNISTUITests.swift in Sources */, + D66840281F9DE8DF00D1DE7F /* ClassifierTests.swift in Sources */, + D66840271F9DE8DF00D1DE7F /* Array.swift in Sources */, + D668402D1F9DE8DF00D1DE7F /* SHA1.swift in Sources */, + D668402A1F9DE8DF00D1DE7F /* DownloaderTests.swift in Sources */, + D66840291F9DE8DF00D1DE7F /* Downloader.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -609,11 +538,6 @@ target = A7C387A51D9F604900091506 /* MNIST */; targetProxy = A7C387BA1D9F604900091506 /* PBXContainerItemProxy */; }; - A7C387C61D9F604A00091506 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = A7C387A51D9F604900091506 /* MNIST */; - targetProxy = A7C387C51D9F604A00091506 /* PBXContainerItemProxy */; - }; A7C387E11D9F611D00091506 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = "______Target_TensorSwift" /* TensorSwift */; @@ -627,20 +551,20 @@ /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ - A7C387AC1D9F604900091506 /* Main.storyboard */ = { + D66840311F9DE8F000D1DE7F /* LaunchScreen.storyboard */ = { isa = PBXVariantGroup; children = ( - A7C387AD1D9F604900091506 /* Base */, + D66840321F9DE8F000D1DE7F /* Base */, ); - name = Main.storyboard; + name = LaunchScreen.storyboard; sourceTree = ""; }; - A7C387B11D9F604900091506 /* LaunchScreen.storyboard */ = { + D66840331F9DE8F000D1DE7F /* Main.storyboard */ = { isa = PBXVariantGroup; children = ( - A7C387B21D9F604900091506 /* Base */, + D66840341F9DE8F000D1DE7F /* Base */, ); - name = LaunchScreen.storyboard; + name = Main.storyboard; sourceTree = ""; }; /* End PBXVariantGroup section */ @@ -689,7 +613,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - INFOPLIST_FILE = MNIST/Info.plist; + INFOPLIST_FILE = Sources/MNIST/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; MTL_ENABLE_DEBUG_INFO = YES; @@ -741,7 +665,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - INFOPLIST_FILE = MNIST/Info.plist; + INFOPLIST_FILE = Sources/MNIST/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; MTL_ENABLE_DEBUG_INFO = NO; @@ -798,7 +722,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - INFOPLIST_FILE = MNISTTests/Info.plist; + INFOPLIST_FILE = Tests/MNISTTests/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MTL_ENABLE_DEBUG_INFO = YES; @@ -807,7 +731,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = iphoneos; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_OBJC_BRIDGING_HEADER = "MNISTTests/MNISTTests-Bridging-Header.h"; + SWIFT_OBJC_BRIDGING_HEADER = "Tests/MNISTTests/MNISTTests-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 3.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/MNIST.app/MNIST"; @@ -851,14 +775,14 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - INFOPLIST_FILE = MNISTTests/Info.plist; + INFOPLIST_FILE = Tests/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_OBJC_BRIDGING_HEADER = "Tests/MNISTTests/MNISTTests-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; SWIFT_VERSION = 3.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/MNIST.app/MNIST"; @@ -866,113 +790,6 @@ }; 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 = { @@ -1076,15 +893,6 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Debug; }; - A7C387D31D9F604A00091506 /* Build configuration list for PBXNativeTarget "MNISTUITests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - A7C387CF1D9F604A00091506 /* Debug */, - A7C387D01D9F604A00091506 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Debug; - }; "___RootConfs_" /* Build configuration list for PBXProject "TensorSwift" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/MNISTTests/Array.swift b/Tests/MNISTTests/Array.swift similarity index 100% rename from MNISTTests/Array.swift rename to Tests/MNISTTests/Array.swift diff --git a/MNISTTests/ClassifierTests.swift b/Tests/MNISTTests/ClassifierTests.swift similarity index 100% rename from MNISTTests/ClassifierTests.swift rename to Tests/MNISTTests/ClassifierTests.swift diff --git a/MNISTTests/Downloader.swift b/Tests/MNISTTests/Downloader.swift similarity index 100% rename from MNISTTests/Downloader.swift rename to Tests/MNISTTests/Downloader.swift diff --git a/MNISTTests/DownloaderTests.swift b/Tests/MNISTTests/DownloaderTests.swift similarity index 100% rename from MNISTTests/DownloaderTests.swift rename to Tests/MNISTTests/DownloaderTests.swift diff --git a/MNISTTests/Info.plist b/Tests/MNISTTests/Info.plist similarity index 100% rename from MNISTTests/Info.plist rename to Tests/MNISTTests/Info.plist diff --git a/MNISTTests/MNISTTests-Bridging-Header.h b/Tests/MNISTTests/MNISTTests-Bridging-Header.h similarity index 100% rename from MNISTTests/MNISTTests-Bridging-Header.h rename to Tests/MNISTTests/MNISTTests-Bridging-Header.h diff --git a/MNISTTests/SHA1.swift b/Tests/MNISTTests/SHA1.swift similarity index 100% rename from MNISTTests/SHA1.swift rename to Tests/MNISTTests/SHA1.swift From be3a7fc1283402cedc72544669cb6e638f76e81a Mon Sep 17 00:00:00 2001 From: Yuta Koshizawa Date: Mon, 23 Oct 2017 18:31:24 +0900 Subject: [PATCH 3/8] Update to Swift 4 --- Sources/MNIST/CanvasView.swift | 4 ++-- Sources/MNIST/ViewController.swift | 2 +- TensorSwift.xcodeproj/project.pbxproj | 23 +++++++++++++++++------ 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/Sources/MNIST/CanvasView.swift b/Sources/MNIST/CanvasView.swift index b3040c0..2ff1888 100644 --- a/Sources/MNIST/CanvasView.swift +++ b/Sources/MNIST/CanvasView.swift @@ -22,7 +22,7 @@ class CanvasView: UIView { 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?.setStrokeColor(UIColor(red: 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() { @@ -36,7 +36,7 @@ class CanvasView: UIView { context?.strokePath() } - func onPanGesture(_ gestureRecognizer: UIPanGestureRecognizer) { + @objc func onPanGesture(_ gestureRecognizer: UIPanGestureRecognizer) { canvas.draw(gestureRecognizer.location(in: self)) if gestureRecognizer.state == .ended { canvas.newLine() diff --git a/Sources/MNIST/ViewController.swift b/Sources/MNIST/ViewController.swift index dc63422..8c3f109 100644 --- a/Sources/MNIST/ViewController.swift +++ b/Sources/MNIST/ViewController.swift @@ -22,7 +22,7 @@ class ViewController: UIViewController { 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 }) + input = Tensor(shape: [Dimension(inputSize), Dimension(inputSize), 1], elements: pixels.map { (pixel: UInt8) -> Float in -(Float(pixel) / 255.0 - 0.5) + 0.5 }) } let estimatedLabel = classifier.classify(input) diff --git a/TensorSwift.xcodeproj/project.pbxproj b/TensorSwift.xcodeproj/project.pbxproj index edd04af..7c3cfc0 100644 --- a/TensorSwift.xcodeproj/project.pbxproj +++ b/TensorSwift.xcodeproj/project.pbxproj @@ -412,14 +412,19 @@ A7C387A51D9F604900091506 = { CreatedOnToolsVersion = 8.0; DevelopmentTeam = 3B8C483UAP; + LastSwiftMigration = 0900; ProvisioningStyle = Automatic; }; A7C387B81D9F604900091506 = { CreatedOnToolsVersion = 8.0; DevelopmentTeam = 3B8C483UAP; + LastSwiftMigration = 0900; ProvisioningStyle = Automatic; TestTargetID = A7C387A51D9F604900091506; }; + "______Target_TensorSwift" = { + LastSwiftMigration = 0900; + }; "______Target_TensorSwiftTests" = { LastSwiftMigration = 0800; }; @@ -623,7 +628,8 @@ SDKROOT = iphoneos; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = On; + SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -673,7 +679,8 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = On; + SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; @@ -733,7 +740,8 @@ SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OBJC_BRIDGING_HEADER = "Tests/MNISTTests/MNISTTests-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = On; + SWIFT_VERSION = 4.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/MNIST.app/MNIST"; }; name = Debug; @@ -784,7 +792,8 @@ SDKROOT = iphoneos; SWIFT_OBJC_BRIDGING_HEADER = "Tests/MNISTTests/MNISTTests-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = On; + SWIFT_VERSION = 4.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/MNIST.app/MNIST"; VALIDATE_PRODUCT = YES; }; @@ -804,7 +813,8 @@ PRODUCT_BUNDLE_IDENTIFIER = TensorSwift; PRODUCT_MODULE_NAME = "$(TARGET_NAME:c99extidentifier)"; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = On; + SWIFT_VERSION = 4.0; }; name = Release; }; @@ -838,7 +848,8 @@ PRODUCT_MODULE_NAME = "$(TARGET_NAME:c99extidentifier)"; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = On; + SWIFT_VERSION = 4.0; }; name = Debug; }; From ed7ae41f034fac987eeb28a36da77737be2975a0 Mon Sep 17 00:00:00 2001 From: Yuta Koshizawa Date: Mon, 23 Oct 2017 18:32:55 +0900 Subject: [PATCH 4/8] Update the project settings to recommended ones --- TensorSwift.xcodeproj/project.pbxproj | 53 +++++++++++++++++-- .../xcschemes/TensorSwift.xcscheme | 4 +- 2 files changed, 53 insertions(+), 4 deletions(-) diff --git a/TensorSwift.xcodeproj/project.pbxproj b/TensorSwift.xcodeproj/project.pbxproj index 7c3cfc0..da102f3 100644 --- a/TensorSwift.xcodeproj/project.pbxproj +++ b/TensorSwift.xcodeproj/project.pbxproj @@ -407,7 +407,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0800; - LastUpgradeCheck = 9999; + LastUpgradeCheck = 0900; TargetAttributes = { A7C387A51D9F604900091506 = { CreatedOnToolsVersion = 8.0; @@ -823,7 +823,6 @@ buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CLANG_ENABLE_MODULES = YES; - 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"; @@ -858,7 +857,6 @@ buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CLANG_ENABLE_MODULES = YES; - 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"; @@ -873,6 +871,30 @@ isa = XCBuildConfiguration; baseConfigurationReference = __PBXFileRef_TensorSwift.xcodeproj/Configs/Project.xcconfig /* TensorSwift.xcodeproj/Configs/Project.xcconfig */; buildSettings = { + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; }; name = Release; }; @@ -880,6 +902,31 @@ isa = XCBuildConfiguration; baseConfigurationReference = __PBXFileRef_TensorSwift.xcodeproj/Configs/Project.xcconfig /* TensorSwift.xcodeproj/Configs/Project.xcconfig */; buildSettings = { + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + ONLY_ACTIVE_ARCH = YES; }; name = Debug; }; diff --git a/TensorSwift.xcodeproj/xcshareddata/xcschemes/TensorSwift.xcscheme b/TensorSwift.xcodeproj/xcshareddata/xcschemes/TensorSwift.xcscheme index e882410..6891d65 100644 --- a/TensorSwift.xcodeproj/xcshareddata/xcschemes/TensorSwift.xcscheme +++ b/TensorSwift.xcodeproj/xcshareddata/xcschemes/TensorSwift.xcscheme @@ -1,6 +1,6 @@ Date: Mon, 23 Oct 2017 18:35:20 +0900 Subject: [PATCH 5/8] Fix warnings related to dependency analysis --- TensorSwift.xcodeproj/project.pbxproj | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/TensorSwift.xcodeproj/project.pbxproj b/TensorSwift.xcodeproj/project.pbxproj index da102f3..9f6968f 100644 --- a/TensorSwift.xcodeproj/project.pbxproj +++ b/TensorSwift.xcodeproj/project.pbxproj @@ -628,7 +628,7 @@ SDKROOT = iphoneos; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_SWIFT3_OBJC_INFERENCE = On; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -679,7 +679,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_SWIFT3_OBJC_INFERENCE = On; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; @@ -740,7 +740,7 @@ SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OBJC_BRIDGING_HEADER = "Tests/MNISTTests/MNISTTests-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_SWIFT3_OBJC_INFERENCE = On; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; SWIFT_VERSION = 4.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/MNIST.app/MNIST"; }; @@ -792,7 +792,7 @@ SDKROOT = iphoneos; SWIFT_OBJC_BRIDGING_HEADER = "Tests/MNISTTests/MNISTTests-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_SWIFT3_OBJC_INFERENCE = On; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; SWIFT_VERSION = 4.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/MNIST.app/MNIST"; VALIDATE_PRODUCT = YES; @@ -813,7 +813,7 @@ PRODUCT_BUNDLE_IDENTIFIER = TensorSwift; PRODUCT_MODULE_NAME = "$(TARGET_NAME:c99extidentifier)"; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; - SWIFT_SWIFT3_OBJC_INFERENCE = On; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; SWIFT_VERSION = 4.0; }; name = Release; @@ -847,7 +847,7 @@ PRODUCT_MODULE_NAME = "$(TARGET_NAME:c99extidentifier)"; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_SWIFT3_OBJC_INFERENCE = On; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; SWIFT_VERSION = 4.0; }; name = Debug; From 8f74098e729cf1f06b6f05bd2f006af53870b56b Mon Sep 17 00:00:00 2001 From: Yuta Koshizawa Date: Mon, 23 Oct 2017 18:36:35 +0900 Subject: [PATCH 6/8] Fix wargings Changed unnecessary `var` to `let`. --- Tests/MNISTTests/Downloader.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/MNISTTests/Downloader.swift b/Tests/MNISTTests/Downloader.swift index b2d9f7d..9a69e65 100644 --- a/Tests/MNISTTests/Downloader.swift +++ b/Tests/MNISTTests/Downloader.swift @@ -3,8 +3,8 @@ import Foundation func downloadTestData() -> (images: Data, labels: Data) { let baseUrl = "http://yann.lecun.com/exdb/mnist/" - var testImagesUrl = URL(string: baseUrl)!.appendingPathComponent("t10k-images-idx3-ubyte.gz") - var testLabelsUrl = URL(string: baseUrl)!.appendingPathComponent("t10k-labels-idx1-ubyte.gz") + let testImagesUrl = URL(string: baseUrl)!.appendingPathComponent("t10k-images-idx3-ubyte.gz") + let testLabelsUrl = URL(string: baseUrl)!.appendingPathComponent("t10k-labels-idx1-ubyte.gz") print("download: \(testImagesUrl)") let testImages = try! Data(contentsOf: testImagesUrl) From d81b980a4b6863f4e237be0b21f85dba3a740f34 Mon Sep 17 00:00:00 2001 From: Yuta Koshizawa Date: Mon, 23 Oct 2017 18:40:41 +0900 Subject: [PATCH 7/8] Minor changes --- Sources/MNIST/Classifier.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/MNIST/Classifier.swift b/Sources/MNIST/Classifier.swift index d3661fb..3c25b8e 100644 --- a/Sources/MNIST/Classifier.swift +++ b/Sources/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.reshaped([1, 7 * 7 * Dimension(64)]) + let h_pool2_flat = h_pool2.reshaped([1, Dimension(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() @@ -33,7 +33,7 @@ extension Classifier { 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 * Dimension(64), 1024], elements: loadFloatArray(path, file: "W_fc1")) + W_fc1 = Tensor(shape: [Dimension(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")) From b4060aee3147b0ee1ca1be51bdfdaf703ec735c4 Mon Sep 17 00:00:00 2001 From: Yuta Koshizawa Date: Mon, 23 Oct 2017 18:44:14 +0900 Subject: [PATCH 8/8] Update README --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 39cf7fc..5d32e67 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # TensorSwift -_TensorSwift_ is a lightweight library to calculate tensors, which has similar APIs to [_TensorFlow_](https://www.tensorflow.org/)'s. _TensorSwift_ is useful to simulate calculating tensors in Swift __using models trained by _TensorFlow___. +_TensorSwift_ is a lightweight library to calculate tensors, which has similar APIs to [_TensorFlow_](https://www.tensorflow.org/)'s. _TensorSwift_ is useful to simulate calculating tensors in Swift **using models trained by _TensorFlow_**. ```swift let a = Tensor(shape: [2, 3], elements: [1, 2, 3, 4, 5, 6]) @@ -31,15 +31,15 @@ public struct Classifier { public let b_fc1: Tensor 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]) 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_pool2_flat = h_pool2.reshaped([1, Dimension(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() @@ -54,7 +54,7 @@ public struct Classifier { ### Swift Package Manager ```swift -.Package(url: "git@github.com:qoncept/TensorSwift.git", majorVersion: 0, minor: 2), +.Package(url: "git@github.com:qoncept/TensorSwift.git", from: "0.2.0"), ``` ### CocoaPods