Skip to content
This repository was archived by the owner on Nov 26, 2025. It is now read-only.

[README] [bug] Learning rate should be defined in train method#41

Merged
meilame-tayebjee merged 1 commit intoInseeFrLab:mainfrom
linogaliana:patch-1
Mar 5, 2025
Merged

[README] [bug] Learning rate should be defined in train method#41
meilame-tayebjee merged 1 commit intoInseeFrLab:mainfrom
linogaliana:patch-1

Conversation

@linogaliana
Copy link
Copy Markdown
Contributor

@linogaliana linogaliana commented Mar 5, 2025

Reproducible example below.

Solution is easy: adding a learning parameter in the README.
Still an error afterwards but it is a different issue

Reprex

Made by ChatGPT

import pandas as pd
from torchFastText import torchFastText

df_train = pd.DataFrame({
    "description_ean": [
        "biere noir olive cereal limonade proteine",
        "noir compote barre",
        "vin olive proteine biscuit fromage",
        "barre saucisson bio vin",
        "noir poulet jambon bio"
    ],
    "variete": [
        "2.7.9.6.6.9999",
        "7.7.7.5.2.9999",
        "4.4.5.5.6.9999",
        "11.9.5.4.6.9999",
        "8.9.1.4.6.9999"
    ]
})

df_test  = df_train.copy() #don't care about this one

model = torchFastText(
    num_tokens=1000000,
    embedding_dim=100,
    min_count=5,
    min_n=3,
    max_n=6,
    len_word_ngrams=True,
    sparse=True
)

# Train the model
model.train(
    X_train=df_train.loc[:, "description_ean"].values,
    y_train=df_train['variete'].values,
    X_val=df_test.loc[:, "description_ean"].values,
    y_val=df_test['variete'].values,
    num_epochs=10,
    batch_size=64,
    #lr=0.01  # Learning rate
)

@meilame-tayebjee meilame-tayebjee self-requested a review March 5, 2025 09:34
@meilame-tayebjee meilame-tayebjee merged commit a7494c4 into InseeFrLab:main Mar 5, 2025
3 checks passed
@linogaliana linogaliana deleted the patch-1 branch March 5, 2025 09:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants