Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Shreyan Chowdhury
moodwalk
Commits
1c07d497
Commit
1c07d497
authored
Sep 24, 2019
by
Shreyan Chowdhury
Browse files
refactoring - shorten file names
parent
c524e4ca
Changes
7
Hide whitespace changes
Inline
Side-by-side
experiments/exp
eriment
_baseline.py
→
experiments/exp_baseline.py
View file @
1c07d497
File moved
experiments/exp
eriment
_crnn.py
→
experiments/exp_crnn.py
View file @
1c07d497
...
...
@@ -37,10 +37,10 @@ def run(hparams):
# callbacks
early_stop
=
EarlyStopping
(
monitor
=
'
val_loss
'
,
monitor
=
'
prauc
'
,
patience
=
20
,
verbose
=
True
,
mode
=
'm
in
'
mode
=
'm
ax
'
)
checkpoint_callback
=
ModelCheckpoint
(
...
...
@@ -68,22 +68,28 @@ def run(hparams):
try
:
trainer
.
fit
(
model
)
test_metrics
=
trainer
.
test
()
logger
.
info
(
test_metrics
)
except
KeyboardInterrupt
:
logger
.
info
(
"Training interrupted"
)
except
:
logger
.
exception
(
msg
=
"Error occurred during train!"
)
exit_experiment
(
'failed'
,
exp
)
try
:
logger
.
info
(
"Starting test..."
)
trainer
.
test
()
except
KeyboardInterrupt
:
logger
.
info
(
"Exiting..."
)
exit_experiment
(
'stopped'
,
exp
)
except
:
logger
.
info
(
"Run interrupted"
)
except
Exception
as
e
:
logger
.
exception
(
msg
=
"Error occurred during test!"
)
exit_experiment
(
'failed'
,
exp
)
# try:
# trainer.fit(model)
# except KeyboardInterrupt:
# logger.info("Training interrupted")
# except:
# logger.exception(msg="Error occurred during train!")
#
# try:
# logger.info("Starting test...")
# test_metrics = trainer.test()
# logger.info(test_metrics)
# except KeyboardInterrupt:
# logger.info("Test interrupted...")
# except:
# logger.exception(msg="Error occurred during test!")
if
__name__
==
'__main__'
:
parent_parser
=
HyperOptArgumentParser
(
strategy
=
'grid_search'
,
add_help
=
False
)
...
...
@@ -93,14 +99,13 @@ if __name__ == '__main__':
default
=
1.0
,
help
=
'how much train data to use'
)
parent_parser
.
add_argument
(
'--max_epochs'
,
type
=
int
,
default
=
10
,
help
=
'maximum number of epochs'
)
# parent_parser.add_argument('--gpus', type=list, default=[0,1],
# help='how many gpus to use in the node.'
# ' value -1 uses all the gpus on the node')
parser
=
Network
.
add_model_specific_args
(
parent_parser
)
hyperparams
=
parser
.
parse_args
()
# run(hyperparams)
# gpus = ['cuda:0', 'cuda:1']
# hyperparams.optimize_parallel_gpu(run, gpus, 5)
run
(
h
yperparams
)
# for hparam_trial in hyperparams.trials(20):
# run(hparam_trial)
for
hparam_trial
in
hyperparams
.
trials
(
3
):
run
(
h
param_trial
)
experiments/exp
eriment
_erf.py
→
experiments/exp_erf.py
View file @
1c07d497
File moved
experiments/exp
eriment
_midlevel.py
→
experiments/exp_midlevel.py
View file @
1c07d497
File moved
experiments/exp
eriment
_midlevel_mtg_joint.py
→
experiments/exp_midlevel_mtg_joint.py
View file @
1c07d497
File moved
experiments/exp
eriment
_resnets.py
→
experiments/exp_resnets.py
View file @
1c07d497
File moved
experiments/exp
eriment
_vggbasic.py
→
experiments/exp_vggbasic.py
View file @
1c07d497
File moved
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