mirror of
https://github.com/clearml/clearml
synced 2025-06-26 18:16:07 +00:00
Clean hyper-parameter example
This commit is contained in:
parent
8aa86225e2
commit
5cae1e8384
@ -5,6 +5,7 @@ from __future__ import division
|
|||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
from argparse import ArgumentParser
|
||||||
|
|
||||||
from absl import app
|
from absl import app
|
||||||
from absl import flags
|
from absl import flags
|
||||||
@ -18,7 +19,7 @@ FLAGS = flags.FLAGS
|
|||||||
flags.DEFINE_string('echo', None, 'Text to echo.')
|
flags.DEFINE_string('echo', None, 'Text to echo.')
|
||||||
flags.DEFINE_string('another_str', 'My string', 'A string', module_name='test')
|
flags.DEFINE_string('another_str', 'My string', 'A string', module_name='test')
|
||||||
|
|
||||||
task = Task.init(project_name='examples', task_name='absl example')
|
task = Task.init(project_name='examples', task_name='hyper-parameters example')
|
||||||
|
|
||||||
flags.DEFINE_integer('echo3', 3, 'Text to echo.')
|
flags.DEFINE_integer('echo3', 3, 'Text to echo.')
|
||||||
flags.DEFINE_string('echo5', '5', 'Text to echo.', module_name='test')
|
flags.DEFINE_string('echo5', '5', 'Text to echo.', module_name='test')
|
||||||
@ -41,10 +42,18 @@ parameters['new_param'] = 'this is new'
|
|||||||
parameters['float'] = '9.9'
|
parameters['float'] = '9.9'
|
||||||
print(parameters)
|
print(parameters)
|
||||||
|
|
||||||
|
|
||||||
def main(_):
|
def main(_):
|
||||||
print('Running under Python {0[0]}.{0[1]}.{0[2]}'.format(sys.version_info), file=sys.stderr)
|
print('Running under Python {0[0]}.{0[1]}.{0[2]}'.format(sys.version_info), file=sys.stderr)
|
||||||
logging.info('echo is %s.', FLAGS.echo)
|
logging.info('echo is %s.', FLAGS.echo)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
parser = ArgumentParser()
|
||||||
|
parser.add_argument('--argparser_int_value', help='integer value', type=int, default=1)
|
||||||
|
parser.add_argument('--argparser_disabled', action='store_true', default=False, help='disables something')
|
||||||
|
parser.add_argument('--argparser_str_value', help='string value', default='a string')
|
||||||
|
|
||||||
|
args = parser.parse_args()
|
||||||
|
|
||||||
app.run(main)
|
app.run(main)
|
Loading…
Reference in New Issue
Block a user