Skip to content

Commit efdb71c

Browse files
authored
[mnist-acgan] Fix toPixels() (#274)
1 parent 31fc433 commit efdb71c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

mnist-acgan/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
/**
1919
* This file loads a pre-trained generator part of an ACGAN and demonstrates
2020
* the generation of fake MNIST images.
21-
*
21+
*
2222
* The pre-trained generator model may come from either of the two sources:
2323
* 1. Running the traning script `gan.js` in the same folder.
2424
* 2. A hosted model, via HTTPS requests.
@@ -105,14 +105,14 @@ async function generateAndVisualizeImages(generator) {
105105
return tf.concat(tf.unstack(generatedImages), 1);
106106
});
107107

108-
await tf.toPixels(combinedFakes, fakeCanvas);
108+
await tf.browser.toPixels(combinedFakes, fakeCanvas);
109109
tf.dispose(combinedFakes);
110110
}
111111

112112
/** Refresh examples of real MNIST images. */
113113
async function drawReals() {
114114
const combinedReals = sampleFromMnistData(10);
115-
await tf.toPixels(combinedReals, realCanvas);
115+
await tf.browser.toPixels(combinedReals, realCanvas);
116116
tf.dispose(combinedReals);
117117
}
118118

@@ -126,7 +126,7 @@ let latentSliders;
126126
*/
127127
function createSliders(generator) {
128128
const latentDims = generator.inputs[0].shape[1];
129-
latentSliders = [];
129+
latentSliders = [];
130130
for (let i = 0; i < latentDims; ++i) {
131131
const slider = document.createElement('input');
132132
slider.setAttribute('type', 'range');

0 commit comments

Comments
 (0)