Skip to content

Commit

Permalink
Resolving documentation build (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
achaiah authored Oct 11, 2021
1 parent b974480 commit 07dfa70
Show file tree
Hide file tree
Showing 19 changed files with 114 additions and 58 deletions.
9 changes: 6 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ __pycache__
build
# sphinx build directory
doc/_build
docs/build
docs/Makefile
docs/make.bat
docs/source/_build
# setup.py dist directory
dist
# Egg metadata
Expand All @@ -23,6 +27,5 @@ dist

.idea
/pywick.egg-info/
docs/build
docs/Makefile
docs/make.bat

pywick/configs/train_classifier_local.yaml
26 changes: 12 additions & 14 deletions docs/source/api/pywick.callbacks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,110 +3,108 @@ Callbacks

.. automodule:: pywick.callbacks
:members:
:undoc-members:
:show-inheritance:

CSVLogger
---------------------------------

.. automodule:: pywick.callbacks.CSVLogger
:members:
:undoc-members:
:exclude-members: on_batch_begin, on_batch_end, on_epoch_begin, on_epoch_end, on_train_begin, on_train_end
:show-inheritance:

Callback
--------------------------------

.. automodule:: pywick.callbacks.Callback
:members:
:undoc-members:
:show-inheritance:

CyclicLRScheduler
-----------------------------------------

.. automodule:: pywick.callbacks.CyclicLRScheduler
:members:
:undoc-members:
:exclude-members: on_batch_begin, on_batch_end, on_epoch_begin, on_epoch_end, on_train_begin, on_train_end
:show-inheritance:

EarlyStopping
-------------------------------------

.. automodule:: pywick.callbacks.EarlyStopping
:members:
:undoc-members:
:exclude-members: on_batch_begin, on_batch_end, on_epoch_begin, on_epoch_end, on_train_begin, on_train_end
:show-inheritance:

ExperimentLogger
----------------------------------------

.. automodule:: pywick.callbacks.ExperimentLogger
:members:
:undoc-members:
:exclude-members: on_batch_begin, on_batch_end, on_epoch_begin, on_epoch_end, on_train_begin, on_train_end
:show-inheritance:

History
-------------------------------

.. automodule:: pywick.callbacks.History
:members:
:undoc-members:
:exclude-members: on_batch_begin, on_batch_end, on_epoch_begin, on_epoch_end, on_train_begin, on_train_end
:show-inheritance:

LRScheduler
-----------------------------------

.. automodule:: pywick.callbacks.LRScheduler
:members:
:undoc-members:
:exclude-members: on_batch_begin, on_batch_end, on_epoch_begin, on_epoch_end, on_train_begin, on_train_end
:show-inheritance:

LambdaCallback
--------------------------------------

.. automodule:: pywick.callbacks.LambdaCallback
:members:
:undoc-members:
:exclude-members: on_batch_begin, on_batch_end, on_epoch_begin, on_epoch_end, on_train_begin, on_train_end
:show-inheritance:

ModelCheckpoint
---------------------------------------

.. automodule:: pywick.callbacks.ModelCheckpoint
:members:
:undoc-members:
:exclude-members: on_batch_begin, on_batch_end, on_epoch_begin, on_epoch_end, on_train_begin, on_train_end
:show-inheritance:

OneCycleLRScheduler
-----------------------------------

.. automodule:: pywick.callbacks.OneCycleLRScheduler
:members:
:undoc-members:
:exclude-members: on_batch_begin, on_batch_end, on_epoch_begin, on_epoch_end, on_train_begin, on_train_end
:show-inheritance:

ReduceLROnPlateau
-----------------------------------------

.. automodule:: pywick.callbacks.ReduceLROnPlateau
:members:
:undoc-members:
:exclude-members: on_batch_begin, on_batch_end, on_epoch_begin, on_epoch_end, on_train_begin, on_train_end
:show-inheritance:

SimpleModelCheckpoint
---------------------------------------------

.. automodule:: pywick.callbacks.SimpleModelCheckpoint
:members:
:undoc-members:
:exclude-members: on_batch_begin, on_batch_end, on_epoch_begin, on_epoch_end, on_train_begin, on_train_end
:show-inheritance:

TQDM
---------------------------------------------

.. automodule:: pywick.callbacks.TQDM
:members:
:undoc-members:
:exclude-members: on_batch_begin, on_batch_end, on_epoch_begin, on_epoch_end, on_train_begin, on_train_end
:show-inheritance:

8 changes: 0 additions & 8 deletions docs/source/api/pywick.datasets.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,63 +11,55 @@ BaseDataset

.. automodule:: pywick.datasets.BaseDataset
:members:
:undoc-members:
:show-inheritance:

CSVDataset
---------------------------------

.. automodule:: pywick.datasets.CSVDataset
:members:
:undoc-members:
:show-inheritance:

ClonedFolderDataset
------------------------------------

.. automodule:: pywick.datasets.ClonedFolderDataset
:members:
:undoc-members:
:show-inheritance:

FolderDataset
------------------------------------

.. automodule:: pywick.datasets.FolderDataset
:members:
:undoc-members:
:show-inheritance:

MultiFolderDataset
-----------------------------------------

.. automodule:: pywick.datasets.MultiFolderDataset
:members:
:undoc-members:
:show-inheritance:

PredictFolderDataset
-------------------------------------------

.. automodule:: pywick.datasets.PredictFolderDataset
:members:
:undoc-members:
:show-inheritance:

TensorDataset
------------------------------------

.. automodule:: pywick.datasets.TensorDataset
:members:
:undoc-members:
:show-inheritance:

UsefulDataset
------------------------------------

.. automodule:: pywick.datasets.UsefulDataset
:members:
:undoc-members:
:show-inheritance:

data utilities
Expand Down
8 changes: 4 additions & 4 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['ntemplates']
# templates_path = ['ntemplates']

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
Expand Down Expand Up @@ -105,7 +105,7 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['nstatic']
# html_static_path = ['nstatic']

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
Expand Down Expand Up @@ -170,7 +170,7 @@
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'pywick', 'pywick Documentation',
author, 'pywick', 'One line description of project.',
author, 'pywick', 'High-level Pytorch training framework that aims to get you up and running quickly with state of the art neural networks.',
'Miscellaneous'),
]

Expand All @@ -182,7 +182,7 @@
"albumentations",
"h5py",
"numpy",
"opencv-python-headless",
"cv2",
"pandas",
"pycm",
"scikit-image",
Expand Down
2 changes: 1 addition & 1 deletion pywick/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '0.6.5'
__version__ = '0.6.0'
__author__ = 'Achaiah'
__description__ = 'High-level batteries-included neural network training library for Pytorch'

Expand Down
54 changes: 46 additions & 8 deletions pywick/callbacks/Callback.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
from typing import Collection


class Callback:
"""
Abstract base class used to build new callbacks. Extend this class to build your own callbacks and overwrite functions
Expand All @@ -6,28 +9,63 @@ class Callback:
"""

def __init__(self):
pass
self.params = None
self.trainer = None

def set_params(self, params):
self.params = params

def set_trainer(self, trainer):
self.trainer = trainer

def on_epoch_begin(self, epoch, logs=None):
def on_epoch_begin(self, epoch: int, logs: Collection = None):
"""
Called at the beginning of a new epoch
:param epoch: epoch number
:param logs: collection of logs to process / parse / add to
:return:
"""
pass

def on_epoch_end(self, epoch, logs=None):
def on_epoch_end(self, epoch: int, logs: Collection = None):
"""
Called at the end of an epoch
:param epoch: epoch number
:param logs: collection of logs to process / parse / add to
:return:
"""
pass

def on_batch_begin(self, batch, logs=None):
def on_batch_begin(self, batch: int, logs: Collection = None):
"""
Called at the beginning of a new batch
:param batch: batch number
:param logs: collection of logs to process / parse / add to
:return:
"""
pass

def on_batch_end(self, batch, logs=None):
def on_batch_end(self, batch: int, logs: Collection = None):
"""
Called at the end of an epoch
:param batch: batch number
:param logs: collection of logs to process / parse / add to
:return:
"""
pass

def on_train_begin(self, logs=None):
def on_train_begin(self, logs: Collection = None):
"""
Called at the beginning of a new training run
:param logs: collection of logs to process / parse / add to
:return:
"""
pass

def on_train_end(self, logs=None):
pass
def on_train_end(self, logs: Collection = None):
"""
Called at the end of a training run
:param logs: collection of logs to process / parse / add to
:return:
"""
pass
3 changes: 3 additions & 0 deletions pywick/callbacks/TQDM.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@


class TQDM(Callback):
"""
Callback that displays progress bar and useful statistics in terminal
"""

def __init__(self):
"""
Expand Down
10 changes: 9 additions & 1 deletion pywick/datasets/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,13 @@
with Pytorch.
"""

from . import BaseDataset, ClonedFolderDataset, CSVDataset, FolderDataset, PredictFolderDataset, UsefulDataset, data_utils
from .BaseDataset import BaseDataset
from .ClonedFolderDataset import ClonedFolderDataset
from .CSVDataset import CSVDataset
from .FolderDataset import FolderDataset
from .MultiFolderDataset import MultiFolderDataset
from .PredictFolderDataset import PredictFolderDataset
from .TensorDataset import TensorDataset
from .UsefulDataset import UsefulDataset
from . import data_utils
from .tnt import *
11 changes: 11 additions & 0 deletions pywick/datasets/tnt/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from .batchdataset import BatchDataset
from .concatdataset import ConcatDataset
from .dataset import Dataset
from .listdataset import ListDataset
from .multipartitiondataset import MultiPartitionDataset
from .resampledataset import ResampleDataset
from .shuffledataset import ShuffleDataset
from .splitdataset import SplitDataset
from .table import *
from .transform import *
from .transformdataset import TransformDataset
2 changes: 2 additions & 0 deletions pywick/datasets/tnt/batchdataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
from pywick.datasets.tnt.dataset import Dataset
from . import transform

__all__ = ['BatchDataset']


class BatchDataset(Dataset):
"""
Expand Down
2 changes: 1 addition & 1 deletion pywick/datasets/tnt/concatdataset.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from pywick.datasets.tnt.dataset import Dataset
from .dataset import Dataset
import numpy as np


Expand Down
Loading

0 comments on commit 07dfa70

Please sign in to comment.