refactoring

This commit is contained in:
frankknoll
2023-03-16 15:50:38 +01:00
parent ab3d5a87bf
commit c6d8b04298

View File

@@ -90,15 +90,15 @@
},
{
"cell_type": "code",
"source": [
"if inColab:\n",
" sys.path.insert(0, srcPath)"
],
"execution_count": null,
"metadata": {
"id": "c-2fE6vZsD7a"
},
"execution_count": null,
"outputs": []
"outputs": [],
"source": [
"if inColab:\n",
" sys.path.insert(0, srcPath)"
]
},
{
"cell_type": "code",
@@ -274,21 +274,6 @@
" return accuracy.result().numpy()"
]
},
{
"cell_type": "code",
"source": [
"def saveModel(srcPath, modelDAO, model):\n",
" modelFilepath = f'{srcPath}/captcha/{model.name}'\n",
" modelDAO.saveModel(model, modelFilepath)\n",
" if inColab:\n",
" GoogleDriveManager.uploadFolderToGoogleDrive(modelFilepath, model.name)"
],
"metadata": {
"id": "WG2rSl9nxZQ0"
},
"execution_count": null,
"outputs": []
},
{
"cell_type": "markdown",
"metadata": {
@@ -325,6 +310,19 @@
"datasetFactory = DatasetFactory(captchaShape, charNumConverter.char_to_num, batch_size = 64)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"def saveModel(model):\n",
" modelFilepath = f'{srcPath}/captcha/{model.name}'\n",
" modelDAO.saveModel(model, modelFilepath)\n",
" if inColab:\n",
" GoogleDriveManager.uploadFolderToGoogleDrive(modelFilepath, model.name)"
]
},
{
"cell_type": "markdown",
"metadata": {
@@ -436,7 +434,7 @@
},
"outputs": [],
"source": [
"saveModel(srcPath, modelDAO, model)"
"saveModel(model)"
]
},
{
@@ -625,14 +623,14 @@
},
{
"cell_type": "code",
"source": [
"saveModel(srcPath, modelDAO, model)"
],
"execution_count": null,
"metadata": {
"id": "FpJTHU6dxOVy"
},
"execution_count": null,
"outputs": []
"outputs": [],
"source": [
"saveModel(model)"
]
}
],
"metadata": {
@@ -662,4 +660,4 @@
},
"nbformat": 4,
"nbformat_minor": 0
}
}