Skip to content

Commit

Permalink
Fix for transformer-with-conv-embed encoder. (#434)
Browse files Browse the repository at this point in the history
* Fix for transformer-with-conv-embed encoder.

* changelog

* version fix
  • Loading branch information
tdomhan authored Jun 13, 2018
1 parent 7a1f3f7 commit bea8e6a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ Note that Sockeye has checks in place to not translate with an old model that wa

Each version section may have have subsections for: _Added_, _Changed_, _Removed_, _Deprecated_, and _Fixed_.

## [1.18.23]
### Fixed
- Correctly create the convolutional embedding layers when the encoder is set to `transformer-with-conv-embed`. Previously
no convolutional layers were added so that a standard Transformer model was trained instead.

## [1.18.22]
### Fixed
- Make sure the default bucket is large enough with word based batching when the source is longer than the target (Previously
Expand Down
2 changes: 1 addition & 1 deletion sockeye/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
# express or implied. See the License for the specific language governing
# permissions and limitations under the License.

__version__ = '1.18.22'
__version__ = '1.18.23'
8 changes: 8 additions & 0 deletions sockeye/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,14 @@ def create_model_config(args: argparse.Namespace,
pool_stride=args.conv_embed_pool_stride,
num_highway_layers=args.conv_embed_num_highway_layers,
dropout=args.conv_embed_dropout)
if args.encoder == C.TRANSFORMER_WITH_CONV_EMBED_TYPE:
config_conv = encoder.ConvolutionalEmbeddingConfig(num_embed=num_embed_source,
output_dim=num_embed_source,
max_filter_width=args.conv_embed_max_filter_width,
num_filters=args.conv_embed_num_filters,
pool_stride=args.conv_embed_pool_stride,
num_highway_layers=args.conv_embed_num_highway_layers,
dropout=args.conv_embed_dropout)

config_encoder, encoder_num_hidden = create_encoder_config(args, max_seq_len_source, max_seq_len_target,
config_conv)
Expand Down

0 comments on commit bea8e6a

Please sign in to comment.