Commit ac2031df authored by Yuxin Wu's avatar Yuxin Wu

Include graph_builder in API doc

parent c7b5a85f
tensorpack.graph_builder package
================================
.. automodule:: tensorpack.graph_builder
:members:
:undoc-members:
:show-inheritance:
...@@ -5,9 +5,10 @@ API Documentation ...@@ -5,9 +5,10 @@ API Documentation
:maxdepth: 1 :maxdepth: 1
models
dataflow dataflow
models
callbacks callbacks
graph_builder
train train
predict predict
tfutils tfutils
......
termcolor termcolor
numpy numpy
tqdm tqdm
decorator
tensorflow tensorflow
Sphinx>=1.6 Sphinx>=1.6
recommonmark==0.4.0 recommonmark==0.4.0
......
...@@ -10,7 +10,7 @@ from ..tfutils.collection import freeze_collection ...@@ -10,7 +10,7 @@ from ..tfutils.collection import freeze_collection
from ..utils.naming import TOWER_FREEZE_KEYS from ..utils.naming import TOWER_FREEZE_KEYS
from .input_source import PlaceholderInput from .input_source import PlaceholderInput
__all__ = ['PredictorFactory'] __all__ = []
class PredictorTowerHandle(object): class PredictorTowerHandle(object):
......
...@@ -105,8 +105,8 @@ class Trainer(object): ...@@ -105,8 +105,8 @@ class Trainer(object):
def register_callback(self, cb): def register_callback(self, cb):
""" """
Use this method before :meth:`Trainer._setup` finishes, Register a callback to the trainer.
to register a callback to the trainer. It can only be called before :meth:`Trainer.train` gets called.
""" """
assert isinstance(cb, Callback), cb assert isinstance(cb, Callback), cb
assert not isinstance(self._callbacks, Callbacks), \ assert not isinstance(self._callbacks, Callbacks), \
...@@ -117,6 +117,10 @@ class Trainer(object): ...@@ -117,6 +117,10 @@ class Trainer(object):
self._callbacks.append(cb) self._callbacks.append(cb)
def register_monitor(self, mon): def register_monitor(self, mon):
"""
Register a monitor to the trainer.
It can only be called before :meth:`Trainer.train` gets called.
"""
assert isinstance(mon, TrainingMonitor), mon assert isinstance(mon, TrainingMonitor), mon
assert not isinstance(self.monitors, Monitors), \ assert not isinstance(self.monitors, Monitors), \
"Cannot register more monitors after trainer was setup!" "Cannot register more monitors after trainer was setup!"
...@@ -200,12 +204,12 @@ class Trainer(object): ...@@ -200,12 +204,12 @@ class Trainer(object):
@property @property
def global_step(self): def global_step(self):
""" """
The tensorflow global_step, i.e. how many times `hooked_sess.run` has been called. The tensorflow global_step, i.e. how many times ``hooked_sess.run`` has been called.
Note: Note:
1. global_step is incremented **after** each `hooked_sess.run` returns from TF runtime. 1. global_step is incremented **after** each ``hooked_sess.run`` returns from TF runtime.
2. If you make zero or more than one calls to `hooked_sess.run` in one 2. If you make zero or more than one calls to ``hooked_sess.run`` in one
`run_step`, local_step and global_step may increment at different speed. :meth:`run_step`, local_step and global_step may increment at different speed.
""" """
return self._global_step return self._global_step
......
...@@ -61,8 +61,8 @@ class TrainConfig(object): ...@@ -61,8 +61,8 @@ class TrainConfig(object):
max_epoch (int): maximum number of epoch to run training. max_epoch (int): maximum number of epoch to run training.
nr_tower (int): number of training towers, used by multigpu trainers. nr_tower (int): number of training towers, used by multigpu trainers.
tower (list of int): list of training towers in relative GPU id. tower ([int]): list of training towers in relative GPU id.
predict_tower (list of int): list of prediction towers in their relative gpu id. Use -1 for cpu. predict_tower ([int]): list of prediction towers in their relative gpu id. Use -1 for cpu.
""" """
# TODO type checker decorator # TODO type checker decorator
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment