Created
October 29, 2020 17:03
-
-
Save N8python/579138a64e516f960c2d9dbd4a7df5b3 to your computer and use it in GitHub Desktop.
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
(async() => { | |
const model = await tf.loadLayersModel('file://./encoder-model/model.json'); | |
const input = tf.input({ shape: [2] }); | |
const dense1 = model.layers[4].apply(input); | |
const dense2 = model.layers[5].apply(dense1); | |
const dense3 = model.layers[6].apply(dense2); | |
const dense4 = model.layers[7].apply(dense3); | |
const decoder = tf.model({ inputs: input, outputs: dense4 }); | |
await decoder.save(`file://./decoder-model`); | |
mnistToImage(decoder.predict(tf.tensor([ | |
[0.3, -0.5] | |
])).dataSync().map(x => x * 255)).pack().pipe(fs.createWriteStream(`plzwork.png`)); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment