Skip to content

Commit

Permalink
instance fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dingguanglei committed Dec 6, 2018
1 parent 6b6fc1d commit 2870ecd
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 26 deletions.
33 changes: 17 additions & 16 deletions jdit/parallel/parallel_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,25 +28,26 @@ class SupParallelTrainer(object):
Example:
unfixed_params_list = [{'task_id':1, 'lr':1e-3,'gpu_ids_abs': [0] },
{'task_id':1, 'lr':1e-4,'gpu_ids_abs': [0] },
{'task_id':2, 'lr':1e-5,'gpu_ids_abs': [2,3] }]
.. code::
unfixed_params_list = [
{'task_id':1, 'lr':1e-3,'gpu_ids_abs': [0] },
{'task_id':1, 'lr':1e-4,'gpu_ids_abs': [0] },
{'task_id':2, 'lr':1e-5,'gpu_ids_abs': [2,3] }]
This set of ``unfixed_params_list`` means that:
Grid table:
+------------+-----------------------+-----------------------+---------------------+
| time_step | 'task_id':1 | 'task_id':2 | |
+============+=======================+=======================+=====================+
| t | 'lr':1e-3, | 'lr':1e-5, | executed parallelly |
| | 'gpu_ids_abs': [0] | 'gpu_ids_abs': [2,3] | |
+------------+-----------------------+-----------------------+---------------------+
| t+1 | 'lr':1e-4, | \ | |
| | 'gpu_ids_abs': [0] | | |
+------------+-----------------------+-----------------------+---------------------+
| | executed sequentially | \ | |
+------------+-----------------------+-----------------------+---------------------+
+------+-----------------------+----------------------+---------------------+
| time | 'task_id':1 | 'task_id':2 | |
+======+=======================+======================+=====================+
| t | 'lr':1e-3, | 'lr':1e-5, | executed parallelly |
| | 'gpu_ids_abs': [0] | 'gpu_ids_abs': [2,3] | |
+------+-----------------------+----------------------+---------------------+
| t+1 | 'lr':1e-4, | \ | |
| | 'gpu_ids_abs': [0] | | |
+------+-----------------------+----------------------+---------------------+
| | executed sequentially | \ | |
+------+-----------------------+----------------------+---------------------+
"""

Expand Down
20 changes: 10 additions & 10 deletions jdit/trainer/classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,16 +163,16 @@ def get_data_from_batch(self, batch_data, device, use_onehot=True):

def _watch_images(self, show_imgs_num=4, tag="Train"):
pass

def _change_lr(self):
self.opt.do_lr_decay()

def _check_point(self):
self.net._check_point("classmodel", self.current_epoch, self.logdir)

def _record_configs(self):
self.loger.regist_config(self.opt, self.current_epoch)
self.loger.regist_config(self.performance, self.current_epoch) # for self.performance.configure
#
# def _change_lr(self):
# self.opt.do_lr_decay()
#
# def _check_point(self):
# self.net._check_point("classmodel", self.current_epoch, self.logdir)

# def _record_configs(self):
# self.loger.regist_config(self.opt, self.current_epoch)
# self.loger.regist_config(self.performance, self.current_epoch) # for self.performance.configure

@property
def configure(self):
Expand Down

0 comments on commit 2870ecd

Please sign in to comment.