cluster same

master
ml server 2020-01-17 14:54:48 -07:00
parent d39a4a30ec
commit fe6817b1d1
1 changed files with 22 additions and 55 deletions

View File

@ -259,8 +259,8 @@
"outputs": [],
"source": [
"print(\"Reduce training and validation set when testing\")\n",
"total_train = 100\n",
"total_val = 100\n",
"#total_train = 1\n",
"#total_val = 1\n",
"print(\"Train =\")\n",
"print(total_train)\n",
"print(\"Validation =\")\n",
@ -277,9 +277,26 @@
"#batch_size = 128\n",
"#epochs = 6\n",
"#\n",
"# Large Test\n",
"#batch_size = 512 # FAIL\n",
"#batch_size = 256 # FAIL\n",
"#batch_size = 192 # BEST SO FAR\n",
"#epochs = 16 # BEST SO FAR\n",
"#\n",
"# Fast, but reasonable answers\n",
"batch_size = 64\n",
"epochs = 4\n",
"# Faster, but reasonable answers ?\n",
"#batch_size = 32\n",
"#epochs = 2\n",
"#\n",
"# Testing, faster more inaccurate results\n",
"batch_size = 16\n",
"epochs = 3"
"#batch_size = 16\n",
"#epochs = 3\n",
"#\n",
"# Smallest set for testing\n",
"#batch_size = 1\n",
"#epochs = 1"
]
},
{
@ -318,17 +335,6 @@
")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"test_image_generator = ImageDataGenerator(\n",
" rescale=1./255\n",
")"
]
},
{
"cell_type": "code",
"execution_count": null,
@ -354,27 +360,6 @@
" class_mode='binary')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"print(test_dir)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"test_data_gen = test_image_generator.flow_from_directory(batch_size=batch_size,\n",
" directory=test_dir,\n",
" target_size=(IMG_HEIGHT, IMG_WIDTH),\n",
" class_mode='binary')"
]
},
{
"cell_type": "code",
"execution_count": null,
@ -393,15 +378,6 @@
"sample_val_images, _ = next(val_data_gen)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"sample_test_images, _ = next(test_data_gen)"
]
},
{
"cell_type": "code",
"execution_count": null,
@ -437,15 +413,6 @@
"plotImages(sample_val_images[0:3])"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"plotImages(sample_test_images[0:3])"
]
},
{
"cell_type": "code",
"execution_count": null,
@ -618,7 +585,7 @@
"metadata": {},
"outputs": [],
"source": [
"model.save('data/wut.h5')"
"model.save('data/hdf/wut-KgazZMKEa74VnquqXLwAvD.h5')"
]
},
{