From 77a671cae0d59f1e53a98f104bd727f0236e136f Mon Sep 17 00:00:00 2001 From: Yuta Koshizawa Date: Wed, 25 May 2016 14:55:06 +0900 Subject: [PATCH] Minor change for README --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 7aa454a..bec0dab 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]) @@ -19,7 +19,7 @@ let ones = Tensor(shape: [2, 3, 4], element: 1) ![deep-mnist.gif](Resources/DeepMnist.gif) -The following is how to simulate [Deep MNIST for Experts](https://www.tensorflow.org/versions/r0.8/tutorials/mnist/pros/index.html), a tutorial of _TensorFlow_, by _TensorSwift_. +The following code shows how to simulate [Deep MNIST for Experts](https://www.tensorflow.org/versions/r0.8/tutorials/mnist/pros/index.html), a tutorial of _TensorFlow_, by _TensorSwift_. ```swift public struct Classifier { @@ -31,17 +31,17 @@ 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 { 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.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 @@ -49,7 +49,7 @@ public struct Classifier { } ``` -## Instration +## Installation ### CocoaPods