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
:maxdepth: 1
models
dataflow
models
callbacks
graph_builder
train
predict
tfutils
......
termcolor
numpy
tqdm
decorator
tensorflow
Sphinx>=1.6
recommonmark==0.4.0
......
......@@ -10,7 +10,7 @@ from ..tfutils.collection import freeze_collection
from ..utils.naming import TOWER_FREEZE_KEYS
from .input_source import PlaceholderInput
__all__ = ['PredictorFactory']
__all__ = []
class PredictorTowerHandle(object):
......
......@@ -105,8 +105,8 @@ class Trainer(object):
def register_callback(self, cb):
"""
Use this method before :meth:`Trainer._setup` finishes,
to register a callback to the trainer.
Register a callback to the trainer.
It can only be called before :meth:`Trainer.train` gets called.
"""
assert isinstance(cb, Callback), cb
assert not isinstance(self._callbacks, Callbacks), \
......@@ -117,6 +117,10 @@ class Trainer(object):
self._callbacks.append(cb)
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 not isinstance(self.monitors, Monitors), \
"Cannot register more monitors after trainer was setup!"
......@@ -200,12 +204,12 @@ class Trainer(object):
@property
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:
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
`run_step`, local_step and global_step may increment at different speed.
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
:meth:`run_step`, local_step and global_step may increment at different speed.
"""
return self._global_step
......
......@@ -61,8 +61,8 @@ class TrainConfig(object):
max_epoch (int): maximum number of epoch to run training.
nr_tower (int): number of training towers, used by multigpu trainers.
tower (list of 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.
tower ([int]): list of training towers in relative GPU id.
predict_tower ([int]): list of prediction towers in their relative gpu id. Use -1 for cpu.
"""
# 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