Skip to content

Commit

Permalink
Fixes trainability of sparse embeddings (#2049)
Browse files Browse the repository at this point in the history
  • Loading branch information
w4nderlust committed May 23, 2022
1 parent 9590ceb commit d58c609
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions ludwig/encoders/category_encoders.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@ class CategoricalSparseEncoder(Encoder):
def __init__(
self,
vocab: List[str],
embedding_size: int = 50,
embeddings_trainable: bool = True,
embeddings_trainable: bool = False,
pretrained_embeddings: Optional[str] = None,
embeddings_on_cpu: bool = False,
dropout: float = 0.0,
Expand All @@ -93,7 +92,7 @@ def __init__(
logger.debug(" Embed")
self.embed = Embed(
vocab=vocab,
embedding_size=embedding_size,
embedding_size=len(vocab),
representation="sparse",
embeddings_trainable=embeddings_trainable,
pretrained_embeddings=pretrained_embeddings,
Expand Down

0 comments on commit d58c609

Please sign in to comment.