Created
November 14, 2018 20:42
-
-
Save Marina-Miranovich/4834f20be080926e7f02ecbc59fa7e0e to your computer and use it in GitHub Desktop.
code_snippet_3 for "Playing Mortal Kombat with TensorFlow.js. Transfer learning and data augmentation" translation
This file contains 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
export const loadModel = async () => { | |
const mn = new mobilenet.MobileNet(1, 1); | |
mn.path = `file://PATH/TO/model.json`; | |
await mn.load(); | |
return (input): tf.Tensor1D => | |
mn.infer(input, 'global_average_pooling2d_1') | |
.reshape([1024]); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment