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

Commit

Permalink
- Conv2D and Conv3D now take dilation as parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
nasimrahaman committed Oct 11, 2017
1 parent f76ded1 commit 733a05f
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions inferno/extensions/layers/convolutional.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,12 +238,14 @@ def __init__(self, in_channels, out_channels, kernel_size, dilation=2):
class Conv2D(ConvActivation):
"""
2D convolutional layer with same padding and orthogonal weight initialization.
This layer does not apply an activation function.
By default, this layer does not apply an activation function.
"""
def __init__(self, in_channels, out_channels, kernel_size, activation=None):
def __init__(self, in_channels, out_channels, kernel_size, dilation=1,
activation=None):
super(Conv2D, self).__init__(in_channels=in_channels,
out_channels=out_channels,
kernel_size=kernel_size,
dilation=dilation,
dim=2,
activation=activation,
initialization=OrthogonalWeightsZeroBias())
Expand All @@ -252,12 +254,14 @@ def __init__(self, in_channels, out_channels, kernel_size, activation=None):
class Conv3D(ConvActivation):
"""
3D convolutional layer with same padding and orthogonal weight initialization.
This layer does not apply an activation function.
By default, this layer does not apply an activation function.
"""
def __init__(self, in_channels, out_channels, kernel_size, activation=None):
def __init__(self, in_channels, out_channels, kernel_size, dilation=1,
activation=None):
super(Conv3D, self).__init__(in_channels=in_channels,
out_channels=out_channels,
kernel_size=kernel_size,
dilation=dilation,
dim=3,
activation=activation,
initialization=OrthogonalWeightsZeroBias())
Expand Down

0 comments on commit 733a05f

Please sign in to comment.