Skip to content

Commit

Permalink
chore: Reflect regularization option
Browse files Browse the repository at this point in the history
The notebooks now explicitly reflect the L2 regularization option.
  • Loading branch information
pierluigiferrari committed Jan 17, 2018
1 parent d1b2e19 commit 2164ff4
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 7 deletions.
9 changes: 7 additions & 2 deletions ssd300_evaluation_COCO.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"from keras import backend as K\n",
Expand Down Expand Up @@ -81,7 +83,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"# 1: Build the Keras model\n",
Expand All @@ -90,6 +94,7 @@
"\n",
"model = ssd_300(image_size=(img_height, img_width, 3),\n",
" n_classes=80,\n",
" l2_regularization=0.0005,\n",
" scales=[0.07, 0.15, 0.33, 0.51, 0.69, 0.87, 1.05], # The scales for Pascal VOC are [0.1, 0.2, 0.37, 0.54, 0.71, 0.88, 1.05]\n",
" aspect_ratios_per_layer=[[1.0, 2.0, 0.5],\n",
" [1.0, 2.0, 0.5, 3.0, 1.0/3.0],\n",
Expand Down
3 changes: 2 additions & 1 deletion ssd300_inference.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
"\n",
"model = ssd_300(image_size=(img_height, img_width, 3),\n",
" n_classes=20,\n",
" l2_regularization=0.0005,\n",
" scales=[0.1, 0.2, 0.37, 0.54, 0.71, 0.88, 1.05], # The scales for MS COCO are [0.07, 0.15, 0.33, 0.51, 0.69, 0.87, 1.05]\n",
" aspect_ratios_per_layer=[[1.0, 2.0, 0.5],\n",
" [1.0, 2.0, 0.5, 3.0, 1.0/3.0],\n",
Expand Down Expand Up @@ -320,8 +321,8 @@
" 'sheep', 'sofa', 'train', 'tvmonitor']\n",
"\n",
"dataset.parse_xml(images_dirs=[VOC_2007_test_images_dir],\n",
" annotations_dirs=[VOC_2007_test_annotations_dir],\n",
" image_set_filenames=[VOC_2007_test_image_set_filename],\n",
" annotations_dirs=[VOC_2007_test_annotations_dir],\n",
" classes=classes,\n",
" include_classes='all',\n",
" exclude_truncated=False,\n",
Expand Down
7 changes: 4 additions & 3 deletions ssd300_training.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@
"\n",
"model = ssd_300(image_size=(img_height, img_width, img_channels),\n",
" n_classes=n_classes,\n",
" l2_regularization=0.0005,\n",
" scales=scales,\n",
" aspect_ratios_per_layer=aspect_ratios,\n",
" two_boxes_for_ar1=two_boxes_for_ar1,\n",
Expand Down Expand Up @@ -269,19 +270,19 @@
"\n",
"train_dataset.parse_xml(images_dirs=[VOC_2007_images_dir,\n",
" VOC_2012_images_dir],\n",
" annotations_dirs=[VOC_2007_annotations_dir,\n",
" VOC_2012_annotations_dir],\n",
" image_set_filenames=[VOC_2007_trainval_image_set_filename,\n",
" VOC_2012_trainval_image_set_filename],\n",
" annotations_dirs=[VOC_2007_annotations_dir,\n",
" VOC_2012_annotations_dir],\n",
" classes=classes,\n",
" include_classes='all',\n",
" exclude_truncated=False,\n",
" exclude_difficult=False,\n",
" ret=False)\n",
"\n",
"val_dataset.parse_xml(images_dirs=[VOC_2007_test_images_dir],\n",
" annotations_dirs=[VOC_2007_test_annotations_dir],\n",
" image_set_filenames=[VOC_2007_test_image_set_filename],\n",
" annotations_dirs=[VOC_2007_test_annotations_dir],\n",
" classes=classes,\n",
" include_classes='all',\n",
" exclude_truncated=False,\n",
Expand Down
3 changes: 2 additions & 1 deletion ssd512_inference.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
"\n",
"model = ssd_512(image_size=(img_height, img_width, 3),\n",
" n_classes=20,\n",
" l2_regularization=0.0005,\n",
" scales=[0.07, 0.15, 0.3, 0.45, 0.6, 0.75, 0.9, 1.05], # The scales for MS COCO are [0.04, 0.1, 0.26, 0.42, 0.58, 0.74, 0.9, 1.06]\n",
" aspect_ratios_per_layer=[[1.0, 2.0, 0.5],\n",
" [1.0, 2.0, 0.5, 3.0, 1.0/3.0],\n",
Expand Down Expand Up @@ -321,8 +322,8 @@
" 'sheep', 'sofa', 'train', 'tvmonitor']\n",
"\n",
"dataset.parse_xml(images_dirs=[VOC_2007_test_images_dir],\n",
" annotations_dirs=[VOC_2007_test_annotations_dir],\n",
" image_set_filenames=[VOC_2007_test_image_set_filename],\n",
" annotations_dirs=[VOC_2007_test_annotations_dir],\n",
" classes=classes,\n",
" include_classes='all',\n",
" exclude_truncated=False,\n",
Expand Down
1 change: 1 addition & 0 deletions ssd7_training.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@
"\n",
"model = build_model(image_size=(img_height, img_width, img_channels),\n",
" n_classes=n_classes,\n",
" l2_regularization=0.0,\n",
" scales=scales,\n",
" aspect_ratios_global=aspect_ratios,\n",
" aspect_ratios_per_layer=None,\n",
Expand Down

0 comments on commit 2164ff4

Please sign in to comment.