Commit 3164613d authored by Yuxin Wu's avatar Yuxin Wu

apidoc

parent fd21c3b1
......@@ -12,8 +12,7 @@
# All configuration values have a default; values that are commented out
# serve to show the default.
import sys
import os
import sys, os, re
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
......@@ -21,10 +20,23 @@ import os
sys.path.insert(0, os.path.abspath('../'))
import mock
#class AttrMock(mock.Mock):
#def __init__(self, name):
#self.__dict__['name'] = name
#def __getattr__(self, attr):
#return AttrMock(self.__dict__['name'] + "." + attr)
#def __str__(self):
#return self.__dict__['name']
#def __call__(self, *args, **kwargs):
#return self.__dict__['name'] + '(' + \
#', '.join(map(str, args)) + ', ' \
#+ ', '.join(["{}={}".format(k,v) for k,v in kwargs.items()]) + ')'
MOCK_MODULES = ['numpy', 'scipy', 'tensorflow', 'scipy.misc', 'h5py', 'nltk',
'cv2', 'scipy.io']
for mod_name in MOCK_MODULES:
sys.modules[mod_name] = mock.Mock()
sys.modules[mod_name] = mock.Mock(name=mod_name)
import tensorpack
from tensorpack.models import *
......@@ -301,5 +313,13 @@ def skip(app, what, name, obj, skip, options):
return False
return skip
def get_rst(app, what, name, obj, options, signature,
return_annotation):
if signature:
signature = re.sub('<Mock name=\'([^\']+)\'.*>', '\g<1>', signature)
signature = re.sub('tensorflow', 'tf')
return signature, return_annotation
def setup(app):
app.connect('autodoc-process-signature', get_rst)
app.connect("autodoc-skip-member", skip)
tensorpack
==========
.. toctree::
:maxdepth: 10
tensorpack
tensorpack.callbacks package
============================
Submodules
----------
tensorpack.callbacks.base module
--------------------------------
.. automodule:: tensorpack.callbacks.base
:members:
:undoc-members:
:show-inheritance:
tensorpack.callbacks.common module
----------------------------------
.. automodule:: tensorpack.callbacks.common
:members:
:undoc-members:
:show-inheritance:
tensorpack.callbacks.dump module
--------------------------------
.. automodule:: tensorpack.callbacks.dump
:members:
:undoc-members:
:show-inheritance:
tensorpack.callbacks.group module
---------------------------------
.. automodule:: tensorpack.callbacks.group
:members:
:undoc-members:
:show-inheritance:
tensorpack.callbacks.inference module
-------------------------------------
.. automodule:: tensorpack.callbacks.inference
:members:
:undoc-members:
:show-inheritance:
tensorpack.callbacks.param module
---------------------------------
.. automodule:: tensorpack.callbacks.param
:members:
:undoc-members:
:show-inheritance:
tensorpack.callbacks.summary module
-----------------------------------
.. automodule:: tensorpack.callbacks.summary
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: tensorpack.callbacks
:members:
:undoc-members:
:show-inheritance:
tensorpack.dataflow.dataset package
===================================
Submodules
----------
tensorpack.dataflow.dataset.cifar10 module
------------------------------------------
.. automodule:: tensorpack.dataflow.dataset.cifar10
:members:
:undoc-members:
:show-inheritance:
tensorpack.dataflow.dataset.ilsvrc module
-----------------------------------------
.. automodule:: tensorpack.dataflow.dataset.ilsvrc
:members:
:undoc-members:
:show-inheritance:
tensorpack.dataflow.dataset.mnist module
----------------------------------------
.. automodule:: tensorpack.dataflow.dataset.mnist
:members:
:undoc-members:
:show-inheritance:
tensorpack.dataflow.dataset.svhn module
---------------------------------------
.. automodule:: tensorpack.dataflow.dataset.svhn
:members:
:undoc-members:
:show-inheritance:
tensorpack.dataflow.dataset.visualqa module
-------------------------------------------
.. automodule:: tensorpack.dataflow.dataset.visualqa
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: tensorpack.dataflow.dataset
:members:
:undoc-members:
:show-inheritance:
tensorpack.dataflow.imgaug package
==================================
Submodules
----------
tensorpack.dataflow.imgaug.base module
--------------------------------------
.. automodule:: tensorpack.dataflow.imgaug.base
:members:
:undoc-members:
:show-inheritance:
tensorpack.dataflow.imgaug.crop module
--------------------------------------
.. automodule:: tensorpack.dataflow.imgaug.crop
:members:
:undoc-members:
:show-inheritance:
tensorpack.dataflow.imgaug.deform module
----------------------------------------
.. automodule:: tensorpack.dataflow.imgaug.deform
:members:
:undoc-members:
:show-inheritance:
tensorpack.dataflow.imgaug.imgproc module
-----------------------------------------
.. automodule:: tensorpack.dataflow.imgaug.imgproc
:members:
:undoc-members:
:show-inheritance:
tensorpack.dataflow.imgaug.noname module
----------------------------------------
.. automodule:: tensorpack.dataflow.imgaug.noname
:members:
:undoc-members:
:show-inheritance:
tensorpack.dataflow.imgaug.paste module
---------------------------------------
.. automodule:: tensorpack.dataflow.imgaug.paste
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: tensorpack.dataflow.imgaug
:members:
:undoc-members:
:show-inheritance:
tensorpack.dataflow package
===========================
Subpackages
-----------
.. toctree::
tensorpack.dataflow.dataset
tensorpack.dataflow.imgaug
Submodules
----------
tensorpack.dataflow.base module
-------------------------------
.. automodule:: tensorpack.dataflow.base
:members:
:undoc-members:
:show-inheritance:
tensorpack.dataflow.common module
---------------------------------
.. automodule:: tensorpack.dataflow.common
:members:
:undoc-members:
:show-inheritance:
tensorpack.dataflow.dftools module
----------------------------------
.. automodule:: tensorpack.dataflow.dftools
:members:
:undoc-members:
:show-inheritance:
tensorpack.dataflow.format module
---------------------------------
.. automodule:: tensorpack.dataflow.format
:members:
:undoc-members:
:show-inheritance:
tensorpack.dataflow.image module
--------------------------------
.. automodule:: tensorpack.dataflow.image
:members:
:undoc-members:
:show-inheritance:
tensorpack.dataflow.prefetch module
-----------------------------------
.. automodule:: tensorpack.dataflow.prefetch
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: tensorpack.dataflow
:members:
:undoc-members:
:show-inheritance:
tensorpack.models package
=========================
Submodules
----------
tensorpack.models.batch_norm module
-----------------------------------
.. automodule:: tensorpack.models.batch_norm
:members:
:undoc-members:
:show-inheritance:
tensorpack.models.conv2d module
-------------------------------
.. automodule:: tensorpack.models.conv2d
:members:
:undoc-members:
:show-inheritance:
tensorpack.models.fc module
---------------------------
.. automodule:: tensorpack.models.fc
:members:
:undoc-members:
:show-inheritance:
tensorpack.models.image_sample module
-------------------------------------
.. automodule:: tensorpack.models.image_sample
:members:
:undoc-members:
:show-inheritance:
tensorpack.models.model_desc module
-----------------------------------
.. automodule:: tensorpack.models.model_desc
:members:
:undoc-members:
:show-inheritance:
tensorpack.models.nonlin module
-------------------------------
.. automodule:: tensorpack.models.nonlin
:members:
:undoc-members:
:show-inheritance:
tensorpack.models.pool module
-----------------------------
.. automodule:: tensorpack.models.pool
:members:
:undoc-members:
:show-inheritance:
tensorpack.models.regularize module
-----------------------------------
.. automodule:: tensorpack.models.regularize
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: tensorpack.models
:members:
:undoc-members:
:show-inheritance:
tensorpack package
==================
Subpackages
-----------
.. toctree::
tensorpack.callbacks
tensorpack.dataflow
tensorpack.models
tensorpack.tfutils
tensorpack.train
tensorpack.utils
Submodules
----------
tensorpack.predict module
-------------------------
.. automodule:: tensorpack.predict
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: tensorpack
:members:
:undoc-members:
:show-inheritance:
tensorpack.tfutils package
==========================
Submodules
----------
tensorpack.tfutils.argscope module
----------------------------------
.. automodule:: tensorpack.tfutils.argscope
:members:
:undoc-members:
:show-inheritance:
tensorpack.tfutils.common module
--------------------------------
.. automodule:: tensorpack.tfutils.common
:members:
:undoc-members:
:show-inheritance:
tensorpack.tfutils.gradproc module
----------------------------------
.. automodule:: tensorpack.tfutils.gradproc
:members:
:undoc-members:
:show-inheritance:
tensorpack.tfutils.modelutils module
------------------------------------
.. automodule:: tensorpack.tfutils.modelutils
:members:
:undoc-members:
:show-inheritance:
tensorpack.tfutils.sessinit module
----------------------------------
.. automodule:: tensorpack.tfutils.sessinit
:members:
:undoc-members:
:show-inheritance:
tensorpack.tfutils.summary module
---------------------------------
.. automodule:: tensorpack.tfutils.summary
:members:
:undoc-members:
:show-inheritance:
tensorpack.tfutils.symbolic_functions module
--------------------------------------------
.. automodule:: tensorpack.tfutils.symbolic_functions
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: tensorpack.tfutils
:members:
:undoc-members:
:show-inheritance:
tensorpack.train package
========================
Submodules
----------
tensorpack.train.base module
----------------------------
.. automodule:: tensorpack.train.base
:members:
:undoc-members:
:show-inheritance:
tensorpack.train.config module
------------------------------
.. automodule:: tensorpack.train.config
:members:
:undoc-members:
:show-inheritance:
tensorpack.train.trainer module
-------------------------------
.. automodule:: tensorpack.train.trainer
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: tensorpack.train
:members:
:undoc-members:
:show-inheritance:
tensorpack.utils package
========================
Submodules
----------
tensorpack.utils.concurrency module
-----------------------------------
.. automodule:: tensorpack.utils.concurrency
:members:
:undoc-members:
:show-inheritance:
tensorpack.utils.fs module
--------------------------
.. automodule:: tensorpack.utils.fs
:members:
:undoc-members:
:show-inheritance:
tensorpack.utils.loadcaffe module
---------------------------------
.. automodule:: tensorpack.utils.loadcaffe
:members:
:undoc-members:
:show-inheritance:
tensorpack.utils.logger module
------------------------------
.. automodule:: tensorpack.utils.logger
:members:
:undoc-members:
:show-inheritance:
tensorpack.utils.lut module
---------------------------
.. automodule:: tensorpack.utils.lut
:members:
:undoc-members:
:show-inheritance:
tensorpack.utils.naming module
------------------------------
.. automodule:: tensorpack.utils.naming
:members:
:undoc-members:
:show-inheritance:
tensorpack.utils.rect module
----------------------------
.. automodule:: tensorpack.utils.rect
:members:
:undoc-members:
:show-inheritance:
tensorpack.utils.stat module
----------------------------
.. automodule:: tensorpack.utils.stat
:members:
:undoc-members:
:show-inheritance:
tensorpack.utils.utils module
-----------------------------
.. automodule:: tensorpack.utils.utils
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: tensorpack.utils
:members:
:undoc-members:
:show-inheritance:
......@@ -6,6 +6,7 @@ import tensorflow as tf
from functools import wraps
import six
import copy
import decorator
from ..tfutils import *
from ..tfutils.modelutils import *
......@@ -23,6 +24,7 @@ def layer_register(summary_activation=False, log_shape=True):
Can be overriden when creating the layer.
:param log_shape: log input/output shape of this layer
"""
@decorator.decorator
def wrapper(func):
@wraps(func)
def wrapped_func(*args, **kwargs):
......
......@@ -24,7 +24,7 @@ def BatchNorm(x, use_local_stat=True, decay=0.9, epsilon=1e-5):
Notes:
* Whole-population mean/variance is calculated by a running-average mean/variance, with decay rate 0.999
* Whole-population mean/variance is calculated by a running-average mean/variance.
* Epsilon for variance is set to 1e-5, as is `torch/nn <https://github.com/torch/nn/blob/master/BatchNormalization.lua>`_.
:param input: a NHWC tensor or a NC vector
......
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