Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

Commit

Permalink
- added a few __all__'s
Browse files Browse the repository at this point in the history
  • Loading branch information
nasimrahaman committed Sep 1, 2017
1 parent 97ba0a9 commit 2a87874
Show file tree
Hide file tree
Showing 10 changed files with 43 additions and 0 deletions.
3 changes: 3 additions & 0 deletions inferno/extensions/containers/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
from ...utils.exceptions import assert_


__all__ = ['NNGraph', 'Graph']


class NNGraph(nx.DiGraph):
"""A NetworkX DiGraph, except that node and edge ordering matters."""
# We don't copy torch tensors, only to have them deleted.
Expand Down
3 changes: 3 additions & 0 deletions inferno/extensions/containers/sequential.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
from ...utils import python_utils as pyu


__all__ = ['Sequential1', 'Sequential2']


class Sequential1(nn.Sequential):
"""Like torch.nn.Sequential, but with a few extra methods."""
def __len__(self):
Expand Down
3 changes: 3 additions & 0 deletions inferno/extensions/criteria/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
from ...utils.exceptions import assert_, ShapeError, NotTorchModuleError


__all__ = ['Criteria', 'As2DCriterion']


class Criteria(nn.Module):
"""Aggregate multiple criteria to one."""
def __init__(self, *criteria):
Expand Down
3 changes: 3 additions & 0 deletions inferno/extensions/criteria/set_similarity_measures.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
from torch.autograd import Variable


__all__ = ['SorensenDiceLoss']


class SorensenDiceLoss(nn.Module):
"""
Computes a loss scalar, which when minimized maximizes the Sorensen-Dice similarity
Expand Down
7 changes: 7 additions & 0 deletions inferno/extensions/initializers/base.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
import torch.nn.init as init


__all__ = ['Initializer',
'Initialization',
'WeightInitFunction',
'BiasInitFunction',
'TensorInitFunction']


class Initializer(object):
"""
Base class for all initializers.
Expand Down
3 changes: 3 additions & 0 deletions inferno/extensions/initializers/presets.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
from .base import Initialization, Initializer


__all__ = ['Constant', 'OrthogonalWeightsZeroBias', 'KaimingNormalWeightsZeroBias']


class Constant(Initializer):
"""Initialize with a constant."""
def __init__(self, constant):
Expand Down
2 changes: 2 additions & 0 deletions inferno/extensions/layers/activations.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
import torch.nn as nn
from ...utils.torch_utils import where

__all__ = ['SELU']


class SELU(nn.Module):
def forward(self, input):
Expand Down
10 changes: 10 additions & 0 deletions inferno/extensions/layers/convolutional.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@
from ..initializers import Initializer


__all__ = ['ConvActivation',
'ConvELU2D', 'ConvELU3D',
'ConvSigmoid2D', 'ConvSigmoid3D',
'DeconvELU2D', 'DeconvELU3D',
'StridedConvELU2D', 'StridedConvELU3D',
'DilatedConvELU2D', 'DilatedConvELU3D',
'Conv2D', 'Conv3D',
'BNReLUConv2D']


class ConvActivation(nn.Module):
"""Convolutional layer with 'SAME' padding followed by an activation."""
def __init__(self, in_channels, out_channels, kernel_size, dim, activation,
Expand Down
2 changes: 2 additions & 0 deletions inferno/extensions/layers/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
from ...utils.python_utils import from_iterable
from ...utils.exceptions import assert_, DeviceError

__all__ = ['DeviceTransfer']


class DeviceTransfer(nn.Module):
"""Layer to transfer variables to a specified device."""
Expand Down
7 changes: 7 additions & 0 deletions inferno/extensions/layers/reshape.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@
from ...utils import python_utils as pyu


__all__ = ['View', 'AsMatrix', 'Flatten',
'As3D', 'As2D',
'Concatenate', 'Cat',
'ResizeAndConcatenate', 'PoolCat',
'Sum', 'Split']


class View(nn.Module):
def __init__(self, as_shape):
super(View, self).__init__()
Expand Down

0 comments on commit 2a87874

Please sign in to comment.