Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Commit

Permalink
Various optimizations
Browse files Browse the repository at this point in the history
  • Loading branch information
jantic committed Apr 21, 2019
1 parent 1227f9e commit cb2aeb2
Show file tree
Hide file tree
Showing 9 changed files with 779 additions and 757 deletions.
17 changes: 9 additions & 8 deletions ColorizeTrainingArtistic.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"outputs": [],
"source": [
"import os\n",
"os.environ['CUDA_VISIBLE_DEVICES']='2' "
"os.environ['CUDA_VISIBLE_DEVICES']='1' "
]
},
{
Expand Down Expand Up @@ -53,7 +53,7 @@
"path_hr = path\n",
"path_lr = path/'bandw'\n",
"\n",
"proj_id = 'ColorizeNew79'\n",
"proj_id = 'Artistic2'\n",
"gen_name = proj_id + '_gen'\n",
"crit_name = proj_id + '_crit'\n",
"\n",
Expand All @@ -62,7 +62,8 @@
"\n",
"TENSORBOARD_PATH = Path('data/tensorboard/' + proj_id)\n",
"\n",
"nf_factor = 1.50"
"nf_factor = 1.50\n",
"pct_start = 1e-4"
]
},
{
Expand Down Expand Up @@ -252,7 +253,7 @@
"metadata": {},
"outputs": [],
"source": [
"learn_gen.fit_one_cycle(2, pct_start=0.8, max_lr=slice(1e-3))"
"learn_gen.fit_one_cycle(1, pct_start=0.8, max_lr=slice(1e-3))"
]
},
{
Expand Down Expand Up @@ -288,7 +289,7 @@
"metadata": {},
"outputs": [],
"source": [
"learn_gen.fit_one_cycle(2, pct_start=0.0001, max_lr=slice(3e-7, 3e-4))"
"learn_gen.fit_one_cycle(1, pct_start=pct_start, max_lr=slice(3e-7, 3e-4))"
]
},
{
Expand Down Expand Up @@ -344,7 +345,7 @@
"metadata": {},
"outputs": [],
"source": [
"learn_gen.fit_one_cycle(2, pct_start=0.0001, max_lr=slice(1e-7,1e-4))"
"learn_gen.fit_one_cycle(1, pct_start=pct_start, max_lr=slice(1e-7,1e-4))"
]
},
{
Expand Down Expand Up @@ -391,7 +392,7 @@
"metadata": {},
"outputs": [],
"source": [
"learn_gen.fit_one_cycle(1, pct_start=0.0001, max_lr=slice(5e-8,5e-5))"
"learn_gen.fit_one_cycle(1, pct_start=pct_start, max_lr=slice(5e-8,5e-5))"
]
},
{
Expand Down Expand Up @@ -889,7 +890,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.0"
"version": "3.7.3"
}
},
"nbformat": 4,
Expand Down
13 changes: 7 additions & 6 deletions ColorizeTrainingStable.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"path_hr = path\n",
"path_lr = path/'bandw'\n",
"\n",
"proj_id = 'ColorizeNew73'\n",
"proj_id = 'Stable'\n",
"gen_name = proj_id + '_gen'\n",
"crit_name = proj_id + '_crit'\n",
"\n",
Expand All @@ -62,7 +62,8 @@
"\n",
"TENSORBOARD_PATH = Path('data/tensorboard/' + proj_id)\n",
"\n",
"nf_factor = 2"
"nf_factor = 2\n",
"pct_start = 1e-4"
]
},
{
Expand Down Expand Up @@ -252,7 +253,7 @@
"metadata": {},
"outputs": [],
"source": [
"learn_gen.fit_one_cycle(2, pct_start=0.8, max_lr=slice(1e-3))"
"learn_gen.fit_one_cycle(1, pct_start=0.8, max_lr=slice(1e-3))"
]
},
{
Expand Down Expand Up @@ -288,7 +289,7 @@
"metadata": {},
"outputs": [],
"source": [
"learn_gen.fit_one_cycle(2, pct_start=0.01, max_lr=slice(3e-7, 3e-4))"
"learn_gen.fit_one_cycle(1, pct_start=pct_start, max_lr=slice(3e-7, 3e-4))"
]
},
{
Expand Down Expand Up @@ -344,7 +345,7 @@
"metadata": {},
"outputs": [],
"source": [
"learn_gen.fit_one_cycle(2, pct_start=0.01, max_lr=slice(1e-7,1e-4))"
"learn_gen.fit_one_cycle(1, pct_start=pct_start, max_lr=slice(1e-7,1e-4))"
]
},
{
Expand Down Expand Up @@ -400,7 +401,7 @@
"metadata": {},
"outputs": [],
"source": [
"learn_gen.fit_one_cycle(1, pct_start=0.01, max_lr=slice(5e-8,5e-5))"
"learn_gen.fit_one_cycle(1, pct_start=pct_start, max_lr=slice(5e-8,5e-5))"
]
},
{
Expand Down
19 changes: 4 additions & 15 deletions ImageColorizer.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,6 @@
"os.environ['CUDA_VISIBLE_DEVICES']='1' "
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from __future__ import print_function\n",
"from ipywidgets import interact, interactive, fixed, interact_manual\n",
"import ipywidgets as widgets"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -100,9 +89,9 @@
"result_path = None\n",
"\n",
"if source_url is not None:\n",
" result_path = colorizer.plot_transformed_image_from_url(url=source_url, path=source_path, render_factor=render_factor)\n",
" result_path = colorizer.plot_transformed_image_from_url(url=source_url, path=source_path, render_factor=render_factor, compare=True)\n",
"else:\n",
" result_path = colorizer.plot_transformed_image(path=source_path, render_factor=render_factor)\n",
" result_path = colorizer.plot_transformed_image(path=source_path, render_factor=render_factor, compare=True)\n",
"\n",
"show_image_in_notebook(result_path)"
]
Expand All @@ -120,8 +109,8 @@
"metadata": {},
"outputs": [],
"source": [
"for i in range(5,46):\n",
" colorizer.plot_transformed_image(source_path, render_factor=i, display_render_factor=True)"
"for i in range(10,46,2):\n",
" colorizer.plot_transformed_image(source_path, render_factor=i, display_render_factor=True, figsize=(8,8))"
]
},
{
Expand Down
Loading

0 comments on commit cb2aeb2

Please sign in to comment.