Skip to content

Commit 0b45246

Browse files
authored
Merge pull request #512 from 1duo/master
sync and update version number
2 parents 875abd9 + 9936428 commit 0b45246

File tree

5 files changed

+15
-17
lines changed

5 files changed

+15
-17
lines changed

contributing.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,3 @@ Additional information regarding APIs, installation and dependencies and more ca
7373
* [coremltools](https://github.com/apple/coremltools)
7474
* [onnx-coreml](https://github.com/onnx/onnx-coreml)
7575
* [tf-coreml](https://github.com/tf-coreml/tf-coreml)
76-

coremltools/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
For more information: http://developer.apple.com/documentation/coreml
2323
"""
2424

25-
__version__ = '3.0'
25+
__version__ = '3.1'
2626

2727
# This is the basic Core ML specification format understood by iOS 11.0
2828
SPECIFICATION_VERSION = 1

coremltools/models/model.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,6 @@ def visualize_spec(self, port=None, input_shape_dict=None, title='CoreML Graph V
372372
373373
Returns
374374
-------
375-
376375
None
377376
378377
Examples

coremltools/test/neural_network/test_keras2.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ def test_pooling(self):
329329
# Create a simple Keras model
330330
model = Sequential()
331331
model.add(Conv2D(input_shape=(64, 64, 3),
332-
filters=32, kernel_size=(5,5), strides=(1,1), activation=None,
332+
filters=32, kernel_size=(5,5), strides=(1,1), activation=None,
333333
padding='valid', use_bias=True))
334334
model.add(MaxPooling2D(pool_size=(2,2)))
335335

@@ -611,7 +611,7 @@ def test_sentiment_analysis(self):
611611
self.assertTrue(spec.HasField('neuralNetwork'))
612612

613613
# Test the inputs and outputs
614-
# We're giving state input and output so expect description to differ.
614+
# We're giving state input and output so expect description to differ.
615615
self.assertEquals(len(spec.description.input), len(input_names) + 2)
616616
self.assertEquals(len(spec.description.output), len(output_names) + 2)
617617

@@ -657,7 +657,7 @@ def test_batchnorm(self):
657657
# Create a simple Keras model
658658
model = Sequential()
659659
model.add(Conv2D(input_shape=(64, 64, 3),
660-
filters=32, kernel_size=(5,5), strides=(1,1), activation=None,
660+
filters=32, kernel_size=(5,5), strides=(1,1), activation=None,
661661
padding='valid', use_bias=True))
662662
# epsilon in CoreML is currently fixed at 1e-5
663663
model.add(BatchNormalization(epsilon=1e-5))
@@ -731,8 +731,8 @@ def test_image_processing(self):
731731
# Create a simple Keras model
732732
model = Sequential()
733733
model.add(Conv2D(input_shape=(64, 64, 3),
734-
filters=32, kernel_size=(5,5),
735-
activation=None, padding='valid',
734+
filters=32, kernel_size=(5,5),
735+
activation=None, padding='valid',
736736
strides=(1, 1), use_bias=True))
737737
input_names = ['input']
738738
output_names = ['output']
@@ -1270,7 +1270,7 @@ def test_updatable_model_flag_cce_string_sgd(self):
12701270
self.assertEqual(sgdopt.miniBatchSize.defaultValue, 16)
12711271
self.assertEqual(sgdopt.momentum.defaultValue, 0.0)
12721272

1273-
1273+
12741274
def test_updatable_model_flag_cce_sgd_string(self):
12751275
"""
12761276
Tests the 'respect_trainable' flag when used along with string
@@ -1344,4 +1344,3 @@ def test_updatable_model_flag_cce_adam_string(self):
13441344
self.assertAlmostEqual(adopt.miniBatchSize.defaultValue, 16)
13451345
self.assertAlmostEqual(adopt.beta1.defaultValue, 0.90, places=5)
13461346
self.assertAlmostEqual(adopt.beta2.defaultValue, 0.999, places=5)
1347-

docs/APIExamples.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
docs/APIExamples.md
12
# API Code snippets
23

34
## Converting between MLModel and Spec
4-
5+
56
```python
67
import coremltools
78

@@ -52,7 +53,7 @@ print_network_spec(spec)
5253

5354
Another useful tool for visualizing CoreML models and models from other frameworks: [Netron](https://github.com/lutzroeder/netron)
5455

55-
## Printing the pre-processing parameters
56+
## Printing the pre-processing parameters
5657

5758
This is useful for image based neural network models
5859

@@ -77,7 +78,7 @@ print(nn.preprocessing)
7778
## Changing MLMultiArray input/output datatypes
7879

7980
[Here](https://github.com/apple/coremltools/blob/d07421460f9f0ad1a2e9cf8b5248670358a24a1a/mlmodel/format/FeatureTypes.proto#L106 ) is the list of supported datatypes.
80-
For instance, change the datatype from 'double' to 'float32':
81+
For instance, change the datatype from 'double' to 'float32':
8182

8283
```python
8384
import coremltools
@@ -115,7 +116,7 @@ import PIL.Image
115116

116117
model = coremltools.models.MLModel('path/to/the/saved/model.mlmodel')
117118

118-
Height = 20 # use the correct input image height
119+
Height = 20 # use the correct input image height
119120
Width = 60 # use the correct input image width
120121

121122

@@ -129,7 +130,7 @@ def load_image(path, resize_to=None):
129130
return img_np, img
130131

131132

132-
# load the image and resize using PIL utilities
133+
# load the image and resize using PIL utilities
133134
_, img = load_image('/path/to/image.jpg', resize_to=(Width, Height))
134135
out_dict = model.predict({'image': img})
135136

@@ -143,8 +144,8 @@ out_dict = model.predict({'image': pil_img})
143144

144145
## Building an mlmodel from scratch using Neural Network Builder
145146

146-
We can use the neural network builder class to construct a CoreML model. Lets look at an example of
147-
making a tiny 2 layer model with a convolution layer (with random weights) and an activation.
147+
We can use the neural network builder class to construct a CoreML model. Lets look at an example of
148+
making a tiny 2 layer model with a convolution layer (with random weights) and an activation.
148149

149150
```python
150151
import coremltools

0 commit comments

Comments
 (0)