Skip to content

Commit

Permalink
Revert "Fixing reproducible training (#5735)"
Browse files Browse the repository at this point in the history
This reverts commit c1ea553.
  • Loading branch information
honnibal authored Jul 9, 2020
1 parent 018319a commit 61f8f11
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 196 deletions.
8 changes: 4 additions & 4 deletions spacy/ml/models/textcat.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,16 @@ def build_text_classifier(
cols = [ORTH, LOWER, PREFIX, SUFFIX, SHAPE, ID]
with Model.define_operators({">>": chain, "|": concatenate, "**": clone}):
lower = HashEmbed(
nO=width, nV=embed_size, column=cols.index(LOWER), dropout=dropout, seed=10
nO=width, nV=embed_size, column=cols.index(LOWER), dropout=dropout
)
prefix = HashEmbed(
nO=width // 2, nV=embed_size, column=cols.index(PREFIX), dropout=dropout, seed=11
nO=width // 2, nV=embed_size, column=cols.index(PREFIX), dropout=dropout
)
suffix = HashEmbed(
nO=width // 2, nV=embed_size, column=cols.index(SUFFIX), dropout=dropout, seed=12
nO=width // 2, nV=embed_size, column=cols.index(SUFFIX), dropout=dropout
)
shape = HashEmbed(
nO=width // 2, nV=embed_size, column=cols.index(SHAPE), dropout=dropout, seed=13
nO=width // 2, nV=embed_size, column=cols.index(SHAPE), dropout=dropout
)

width_nI = sum(layer.get_dim("nO") for layer in [lower, prefix, suffix, shape])
Expand Down
10 changes: 5 additions & 5 deletions spacy/ml/models/tok2vec.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,16 +154,16 @@ def LayerNormalizedMaxout(width, maxout_pieces):
def MultiHashEmbed(
columns, width, rows, use_subwords, pretrained_vectors, mix, dropout
):
norm = HashEmbed(nO=width, nV=rows, column=columns.index("NORM"), dropout=dropout, seed=6)
norm = HashEmbed(nO=width, nV=rows, column=columns.index("NORM"), dropout=dropout)
if use_subwords:
prefix = HashEmbed(
nO=width, nV=rows // 2, column=columns.index("PREFIX"), dropout=dropout, seed=7
nO=width, nV=rows // 2, column=columns.index("PREFIX"), dropout=dropout
)
suffix = HashEmbed(
nO=width, nV=rows // 2, column=columns.index("SUFFIX"), dropout=dropout, seed=8
nO=width, nV=rows // 2, column=columns.index("SUFFIX"), dropout=dropout
)
shape = HashEmbed(
nO=width, nV=rows // 2, column=columns.index("SHAPE"), dropout=dropout, seed=9
nO=width, nV=rows // 2, column=columns.index("SHAPE"), dropout=dropout
)

if pretrained_vectors:
Expand Down Expand Up @@ -192,7 +192,7 @@ def MultiHashEmbed(

@registry.architectures.register("spacy.CharacterEmbed.v1")
def CharacterEmbed(columns, width, rows, nM, nC, features, dropout):
norm = HashEmbed(nO=width, nV=rows, column=columns.index("NORM"), dropout=dropout, seed=5)
norm = HashEmbed(nO=width, nV=rows, column=columns.index("NORM"), dropout=dropout)
chr_embed = _character_embed.CharacterEmbed(nM=nM, nC=nC)
with Model.define_operators({">>": chain, "|": concatenate}):
embed_layer = chr_embed | features >> with_array(norm)
Expand Down
31 changes: 0 additions & 31 deletions spacy/tests/regression/test_issue5551.py

This file was deleted.

156 changes: 0 additions & 156 deletions spacy/tests/test_models.py

This file was deleted.

0 comments on commit 61f8f11

Please sign in to comment.