Skip to content

Commit

Permalink
Merge pull request #38 from bjherger/embedding_hotfix
Browse files Browse the repository at this point in the history
Adding another input index to embeddings, as buffer
  • Loading branch information
bjherger committed Jul 25, 2018
2 parents 8be9003 + b6dc357 commit 274f8af
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions keras_pandas/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def input_nub_categorical_handler(variable, input_dataframe):
input_sequence_length = 1

# TODO Convert below to numpy.max (?)
categorical_num_levels = int(max(transformed)) + 1
categorical_num_levels = int(max(transformed)) + 2
embedding_output_dim = int(min((categorical_num_levels + 1) / 2, 50))

logging.info('Creating embedding for cat_var: {}, with input_sequence_length: {}, categorical_num_levels: {}, '
Expand Down Expand Up @@ -99,7 +99,7 @@ def input_nub_text_handler(variable, input_dataframe):
input_sequence_length = 1

# Get the vocab size (number of rows in the embedding)
vocab_size = int(numpy.max(transformed)) + 1
vocab_size = int(numpy.max(transformed)) + 2

# Determine the embedding output size (number of columns in the embedding)
# TODO There must be a better heuristic
Expand Down

0 comments on commit 274f8af

Please sign in to comment.