File tree Expand file tree Collapse file tree 1 file changed +32
-4
lines changed Expand file tree Collapse file tree 1 file changed +32
-4
lines changed Original file line number Diff line number Diff line change 1110
1110
"outputs" : [],
1111
1111
"source" : [
1112
1112
" predictions_lite = classify_lite(sequential_1_input=img_array)['outputs']\n " ,
1113
- " score_lite = tf.nn.softmax(predictions_lite)\n " ,
1114
- " \n " ,
1115
- " assert np.allclose(predictions, predictions_lite)\n " ,
1116
- " \n " ,
1113
+ " score_lite = tf.nn.softmax(predictions_lite)"
1114
+ ]
1115
+ },
1116
+ {
1117
+ "cell_type" : " code" ,
1118
+ "execution_count" : null ,
1119
+ "metadata" : {
1120
+ "id" : " ZKP_GFeKUWb5"
1121
+ },
1122
+ "outputs" : [],
1123
+ "source" : [
1117
1124
" print(\n " ,
1118
1125
" \" This image most likely belongs to {} with a {:.2f} percent confidence.\"\n " ,
1119
1126
" .format(class_names[np.argmax(score_lite)], 100 * np.max(score_lite))\n " ,
1120
1127
" )"
1121
1128
]
1122
1129
},
1130
+ {
1131
+ "cell_type" : " markdown" ,
1132
+ "metadata" : {
1133
+ "id" : " Poz_iYgeUg_U"
1134
+ },
1135
+ "source" : [
1136
+ " The prediction generated by the lite model should be almost identical to the predictions generated by the original model:"
1137
+ ]
1138
+ },
1139
+ {
1140
+ "cell_type" : " code" ,
1141
+ "execution_count" : null ,
1142
+ "metadata" : {
1143
+ "id" : " InXXDJL8UYC1"
1144
+ },
1145
+ "outputs" : [],
1146
+ "source" : [
1147
+ " print(np.max(np.abs(predictions - predictions_lite)))"
1148
+ ]
1149
+ },
1123
1150
{
1124
1151
"cell_type" : " markdown" ,
1125
1152
"metadata" : {
1148
1175
"colab" : {
1149
1176
"collapsed_sections" : [],
1150
1177
"name" : " classification.ipynb" ,
1178
+ "provenance" : [],
1151
1179
"toc_visible" : true
1152
1180
},
1153
1181
"kernelspec" : {
You can’t perform that action at this time.
0 commit comments