Skip to content
This repository has been archived by the owner on Aug 3, 2021. It is now read-only.

Commit

Permalink
Making dilation default parameter and adding it to unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
xravitejax committed Aug 24, 2018
1 parent 0f8f86b commit 79824be
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
11 changes: 6 additions & 5 deletions open_seq2seq/parts/cnns/conv_blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
}

def conv_actv(layer_type, name, inputs, filters, kernel_size, activation_fn, strides,
padding, dilation, regularizer, training, data_format):
padding, regularizer, training, data_format, dilation=1):
"""Helper function that applies convolution and activation.
Args:
layer_type: the following types are supported
Expand Down Expand Up @@ -41,8 +41,8 @@ def conv_actv(layer_type, name, inputs, filters, kernel_size, activation_fn, str


def conv_bn_actv(layer_type, name, inputs, filters, kernel_size, activation_fn, strides,
padding, dilation, regularizer, training, data_format, bn_momentum,
bn_epsilon):
padding, regularizer, training, data_format, bn_momentum,
bn_epsilon, dilation=1):
"""Helper function that applies convolution, batch norm and activation.
Args:
layer_type: the following types are supported
Expand Down Expand Up @@ -91,7 +91,7 @@ def conv_bn_actv(layer_type, name, inputs, filters, kernel_size, activation_fn,


def conv_ln_actv(layer_type, name, inputs, filters, kernel_size, activation_fn, strides,
padding, dilation, regularizer, training, data_format):
padding, regularizer, training, data_format, dilation=1):
"""Helper function that applies convolution, layer norm and activation.
Args:
layer_type: the following types are supported
Expand Down Expand Up @@ -132,7 +132,7 @@ def conv_ln_actv(layer_type, name, inputs, filters, kernel_size, activation_fn,
return output

def conv_in_actv(layer_type, name, inputs, filters, kernel_size, activation_fn, strides,
padding, dilation, regularizer, training, data_format):
padding, regularizer, training, data_format, dilation=1):
"""Helper function that applies convolution, instance norm and activation.
Args:
layer_type: the following types are supported
Expand Down Expand Up @@ -162,3 +162,4 @@ def conv_in_actv(layer_type, name, inputs, filters, kernel_size, activation_fn,
if activation_fn is not None:
output = activation_fn(output)
return output

Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,14 @@
{
"type": "conv1d", "repeat": 3,
"kernel_size": [7], "stride": [1],
"num_channels": 200, "padding": "SAME"
"num_channels": 200, "padding": "SAME",
"dilation":[1]
},
{
"type": "conv1d", "repeat": 1,
"kernel_size": [1], "stride": [1],
"num_channels": 400, "padding": "SAME" # n_hidden=num_channels
"num_channels": 400, "padding": "SAME",
"dilation":[1]
},
],

Expand Down

0 comments on commit 79824be

Please sign in to comment.