Skip to content

Commit

Permalink
Add sphinx-argparse, fix doc errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Rasmus Diederichsen committed Mar 5, 2018
1 parent b19139a commit ea68d58
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 18 deletions.
3 changes: 2 additions & 1 deletion doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
'sphinx.ext.viewcode',
'sphinx.ext.autosummary',
'sphinx.ext.napoleon',
'sphinxarg.ext',
'sphinx.ext.githubpages',
]

Expand Down Expand Up @@ -79,7 +80,7 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'alabaster'
html_theme = 'pyramid'

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
Expand Down
1 change: 1 addition & 0 deletions doc/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Welcome to DeepVO's documentation!
:caption: Contents:

modules
command_line_usage



Expand Down
2 changes: 1 addition & 1 deletion doc/source/modules.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
final_project
DeepVO
=============

.. toctree::
Expand Down
13 changes: 8 additions & 5 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
'''
.. module:: main
Module for starting the training, testing and plotting functions
.. moduleauthor:: Rasmus Diederichsen
'''

import sys
Expand All @@ -21,8 +20,8 @@
from utils import DataManager, OptimizerSpec
from performance_visualizer import PerformanceVisualizer

def main():

def make_parser():
'''Function returning parser is necessary for sphinx-argparse'''
tf_optimizers = {class_name[:-len('Optimizer')] for class_name in dir(tf.train) if 'Optimizer'
in class_name and class_name != 'Optimizer'}
parser = ArgumentParser('Train the DeepVO model')
Expand All @@ -49,7 +48,11 @@ def main():
help='Resize images to long edge')
parser.add_argument('-c', '--load-checkpoint', action='store_true', default=False,
help='Load checkpoint from checkpoints/deepvo.ckpt')
args = parser.parse_args()
return parser

def main():

args = make_parser().parse_args()

data_manager_args = {
'dataset_path': args.dataset,
Expand Down
7 changes: 4 additions & 3 deletions model.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
'''
.. module:: model
Contains :py:class:`VOModel`, an implementation of DeepVO: Towards End-to-End Visual Odometry with Deep Recurrent
Convolutional Neural Networks by Wang et al.
Contains :py:class:`VOModel`, an implementation of DeepVO: Towards End-to-End Visual Odometry with Deep Recurrent
Convolutional Neural Networks by Wang et al.
.. moduleauthor:: Rasmus Diederichsen
Expand Down Expand Up @@ -67,7 +68,7 @@ def __init__(self,
use_dropout : bool
Do not use dropout for LSTM cells
use_flownet : bool
Name CNN vars according to flownet naming scheme. You _must_ call
Name CNN vars according to flownet naming scheme. You *must* call
:py:meth:`load_flownet` before pushing stuff through the graph.
'''
if not optimizer_spec:
Expand Down
4 changes: 2 additions & 2 deletions performance_visualizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

class PerformanceVisualizer(object):

"""This class visualizes the performance of the network by plotting the percentage of the offset"""
'''This class visualizes the performance of the network by plotting the percentage of the offset'''

def __init__(self):
super(PerformanceVisualizer, self).__init__()
Expand Down Expand Up @@ -98,5 +98,5 @@ def main():
p.plot()


if __name__ == "__main__":
if __name__ == '__main__':
main()
3 changes: 2 additions & 1 deletion preprocess_data.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/usr/bin/env python
'''
.. module:: preprocess_data
Contains functions for normalizing and converting the raw data.
Contains functions for normalizing and converting the raw data.
.. moduleauthor:: Rasmus Diederichsen
'''
Expand Down
3 changes: 2 additions & 1 deletion sequence_visualizer.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'''
.. module:: sequence_visualizer
Contains the :py:class:`SequenceVisualizer` to visualise training success.
Contains the :py:class:`SequenceVisualizer` to visualise trajectory
.. moduleauthor:: Christian Heiden
'''
Expand Down
9 changes: 5 additions & 4 deletions utils.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
'''
.. module:: utils
Miscellaneous functions for data processing and batching. This module defines - among other things -
:py:class:`OptimizerSpec` for specifying optimizers, and :py:class:`DataManager` to partition
the data into batches.
Miscellaneous functions for data processing and batching. This module defines - among other things -
:py:class:`OptimizerSpec` for specifying optimizers, and :py:class:`DataManager` to partition
the data into batches.
.. moduleauthor Rasmus Diederichsen, Alexander Mock
'''
Expand All @@ -16,7 +17,7 @@ def tensor_from_lstm_tuple(tuples, validate_shape=False):
We do not check all possible error cases. For instance, the different LSTMStateTuples could
not only have differing shapes (which we check for to some extend see ``validate_shape``
parameter), but also the state members ``c`` and ``h`` could differ in their data type (Tensor,
array), which we _do not_ check.
array), which we *do not* check.
Parameters
Expand Down

0 comments on commit ea68d58

Please sign in to comment.