File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
site/en/r2/tutorials/distribute Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change 190
190
" num_train_examples = ds_info.splits['train'].num_examples\n " ,
191
191
" num_test_examples = ds_info.splits['test'].num_examples\n " ,
192
192
" \n " ,
193
- " BUFFER_SIZE = num_train_examples \n " ,
193
+ " BUFFER_SIZE = 10000 \n " ,
194
194
" BATCH_SIZE = 64"
195
195
]
196
196
},
217
217
" def scale(image, label):\n " ,
218
218
" image = tf.cast(image, tf.float32)\n " ,
219
219
" image /= 255\n " ,
220
- " return image, label"
220
+ " \n " ,
221
+ " return image, label[..., tf.newaxis]"
221
222
]
222
223
},
223
224
{
318
319
" tf.keras.layers.Dense(64, activation='relu'),\n " ,
319
320
" tf.keras.layers.Dense(10, activation='softmax')\n " ,
320
321
" ])\n " ,
321
- " # TODO(yashkatariya): Add accuracy when b/122371345 is fixed. \n " ,
322
+ " \n " ,
322
323
" model.compile(loss='sparse_categorical_crossentropy',\n " ,
323
- " optimizer=tf.keras.optimizers.Adam()) \n " ,
324
- " # metrics=['accuracy'])"
324
+ " optimizer=tf.keras.optimizers.Adam(), \n " ,
325
+ " metrics=['accuracy'])"
325
326
]
326
327
},
327
328
{
You can’t perform that action at this time.
0 commit comments