Skip to content

Commit

Permalink
Updated model
Browse files Browse the repository at this point in the history
  • Loading branch information
KD-3 committed Jun 26, 2020
1 parent 028eab2 commit 9ff5820
Showing 1 changed file with 55 additions and 1 deletion.
56 changes: 55 additions & 1 deletion BTP_MobileNet_Model.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"colab": {
"name": "BTP_MobileNet_Model.ipynb",
"provenance": [],
"authorship_tag": "ABX9TyOA6casfH36cpL6wCD15M4m"
"authorship_tag": "ABX9TyPn5kCKDiXOrbygHv1RJLp/"
},
"kernelspec": {
"name": "python3",
Expand Down Expand Up @@ -142,6 +142,60 @@
],
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "CtKQnHUT1O1B",
"colab_type": "code",
"colab": {}
},
"source": [
"# add custom Layers\n",
"x = MobileNet_model.output\n",
"x = GlobalAveragePooling2D()(x)\n",
"x = Dense(512, activation=\"relu\")(x)\n",
"Custom_Output = Dense(num_classes, activation='softmax')(x)\n"
],
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "ld4qzmpx1XCO",
"colab_type": "code",
"colab": {}
},
"source": [
"model = Model(inputs = MobileNet_model.input, outputs = Custom_Output)\n",
" \n",
"# compile the model\n",
"model.compile(loss='categorical_crossentropy',\n",
" optimizer='adam',\n",
" metrics=['accuracy'])\n",
"\n",
"model.summary()"
],
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "C6Z6WQzh1fDZ",
"colab_type": "code",
"colab": {}
},
"source": [
"history = model.fit(x_train, y_train,\n",
" batch_size=batch_size,\n",
" epochs=num_epochs,\n",
" verbose=1,\n",
" validation_split=0.1)"
],
"execution_count": null,
"outputs": []
}
]
}

0 comments on commit 9ff5820

Please sign in to comment.