Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
22_23-J 65
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
22_23-J 65
22_23-J 65
Commits
c85ca861
Commit
c85ca861
authored
Jan 31, 2023
by
Manukalpani G.S. IT19111698
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Top view model part two modified
parent
78a3dad9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
108 additions
and
0 deletions
+108
-0
Backend/.ipynb_checkpoints/SF_Weed_identification_Finalized-checkpoint.ipynb
...kpoints/SF_Weed_identification_Finalized-checkpoint.ipynb
+54
-0
Backend/SF_Weed_identification_Finalized.ipynb
Backend/SF_Weed_identification_Finalized.ipynb
+54
-0
No files found.
Backend/.ipynb_checkpoints/SF_Weed_identification_Finalized-checkpoint.ipynb
View file @
c85ca861
...
...
@@ -524,6 +524,60 @@
"ensemble_model = Model(inputs = model_input , outputs = ensemble_output , name = 'ensemble')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"#compile the ensemble model with adam optimizer + CategoricalCrossentropy as the loss function\n",
"ensemble_model.compile(optimizer='adam' , loss = tf.losses.CategoricalCrossentropy(from_logits=False), metrics =['accuracy'])"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"def plot_loss_curve(history):\n",
" '''\n",
" Return separate loss curves for training and validation metrics\n",
" '''\n",
" loss = history.history[\"loss\"]\n",
" val_loss = history.history[\"val_loss\"]\n",
"\n",
" accuracy = history.history[\"accuracy\"]\n",
" val_accuracy = history.history[\"val_accuracy\"]\n",
"\n",
" #get the number of epochs that we run for\n",
" epochs = range(len(history.history[\"loss\"]))\n",
"\n",
" #Plot the lost\n",
" plt.plot(epochs , loss , label=\"Training Loss\")\n",
" plt.plot(epochs , val_loss , label=\"Validation Loss\")\n",
" plt.title(\"Loss\")\n",
" plt.xlabel(\"Epochs\")\n",
" plt.legend()\n",
"\n",
" #Plot the accuracy\n",
" plt.figure()\n",
" plt.plot(epochs , accuracy , label=\"Training accuracy\")\n",
" plt.plot(epochs , val_accuracy , label=\"Validation accuracy\")\n",
" plt.title(\"accuracy\")\n",
" plt.xlabel(\"Epochs\")\n",
" plt.legend()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"plot_loss_curve(ensemble_hist)"
]
},
{
"cell_type": "code",
"execution_count": null,
...
...
Backend/SF_Weed_identification_Finalized.ipynb
View file @
c85ca861
...
...
@@ -524,6 +524,60 @@
"ensemble_model = Model(inputs = model_input , outputs = ensemble_output , name = 'ensemble')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"#compile the ensemble model with adam optimizer + CategoricalCrossentropy as the loss function\n",
"ensemble_model.compile(optimizer='adam' , loss = tf.losses.CategoricalCrossentropy(from_logits=False), metrics =['accuracy'])"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"def plot_loss_curve(history):\n",
" '''\n",
" Return separate loss curves for training and validation metrics\n",
" '''\n",
" loss = history.history[\"loss\"]\n",
" val_loss = history.history[\"val_loss\"]\n",
"\n",
" accuracy = history.history[\"accuracy\"]\n",
" val_accuracy = history.history[\"val_accuracy\"]\n",
"\n",
" #get the number of epochs that we run for\n",
" epochs = range(len(history.history[\"loss\"]))\n",
"\n",
" #Plot the lost\n",
" plt.plot(epochs , loss , label=\"Training Loss\")\n",
" plt.plot(epochs , val_loss , label=\"Validation Loss\")\n",
" plt.title(\"Loss\")\n",
" plt.xlabel(\"Epochs\")\n",
" plt.legend()\n",
"\n",
" #Plot the accuracy\n",
" plt.figure()\n",
" plt.plot(epochs , accuracy , label=\"Training accuracy\")\n",
" plt.plot(epochs , val_accuracy , label=\"Validation accuracy\")\n",
" plt.title(\"accuracy\")\n",
" plt.xlabel(\"Epochs\")\n",
" plt.legend()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"plot_loss_curve(ensemble_hist)"
]
},
{
"cell_type": "code",
"execution_count": null,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment