Created
March 5, 2019 04:17
-
-
Save jamesonthecrow/4b07049baecf543ec0f60ea79e7a59b5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Instance Norm | |
| inpt = keras.layers.Input(shape=(500, 500, 3)) | |
| out = keras_contrib.layers.InstanceNormalization(axis=-1)(inpt) | |
| keras_model = keras.models.Model(inpt, out) | |
| mlmodel = coremltools.converters.keras.convert( | |
| keras_model, | |
| add_custom_layers=True, | |
| custom_conversion_functions={} | |
| ) | |
| mlmodel.get_spec() | |
| """ | |
| Output: | |
| specificationVersion: 2 | |
| description { | |
| input { | |
| name: "input1" | |
| type { | |
| multiArrayType { | |
| shape: 3 | |
| shape: 500 | |
| shape: 500 | |
| dataType: DOUBLE | |
| } | |
| } | |
| } | |
| output { | |
| name: "output1" | |
| type { | |
| multiArrayType { | |
| shape: 3 | |
| shape: 500 | |
| shape: 500 | |
| dataType: DOUBLE | |
| } | |
| } | |
| } | |
| } | |
| neuralNetwork { | |
| layers { | |
| name: "instance_normalization_2" | |
| input: "input1" | |
| output: "output1" | |
| custom { | |
| } | |
| } | |
| } | |
| """ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment