<jupyter_start><jupyter_text>Args<jupyter_code>args = Namespace(
    # Data and Path information
    surname_csv="data/surnames/surnames_with_splits.csv",
    vectorizer_file="vectorizer.json",
    model_state_file="model.pth",
    save_dir="model_storage/ch7/model2_conditioned_surname_generation",
    # Model hyper parameters
    char_embedding_size=32,
    rnn_hidden_size=32,
    # Training hyper parameters
    seed=1337,
    learning_rate=0.001,
    batch_size=128,
    num_epochs=10,
    early_stopping_criteria=5,
    # Runtime options
    catch_keyboard_interrupt=True,
    cuda=True,
    expand_filepaths_to_save_dir=True,
    reload_from_files=False,
    conditioned=True
)<jupyter_output><empty_output><jupyter_text>Learner<jupyter_code>learner=Learner.learner_from_args(args)<jupyter_output>Expanded filepaths: 
	model_storage/ch7/model2_conditioned_surname_generation\vectorizer.json
	model_storage/ch7/model2_conditioned_surname_generation\model.pth
Using CUDA: False
Loading dataset and creating vectorizer<jupyter_text>Train<jupyter_code>learner.train()
learner.validate()<jupyter_output>Test loss: 2.776
Test Accuracy: 21.825<jupyter_text>Generate<jupyter_code>learner.generate(3)<jupyter_output>Sampled for Arabic: 
-  Surkin
-  Anan
-  Hhasaon
Sampled for Chinese: 
-  ta
-  Aeh
-  Kiy
Sampled for Czech: 
-  Ha
-  Beh
-  Taatyela
Sampled for Dutch: 
-  áealeVivenri
-  Mrrtge
-  Daele
Sampled for English: 
-  SaTutot
-  Ltbinss
-  Socerh
Sampled for French: 
-  Dehe
-  Vada
-  Pmhtn
Sampled for German: 
-  Det
-  Cineo
-  Sellec
Sampled for Greek: 
-  Lltedn
-  Ha
-  Taha
Sampled for Irish: 
-  Amte
-  Osaeuo
-  Wenr
Sampled for Italian: 
-  JiHbar
-  Celte
-  iie
Sampled for Japanese: 
-  Hra
-  Iaetb
-  Karda
Sampled for Korean: 
-  Mel
-  Soirei
-  Oeo
Sampled for Polish: 
-  Mbetv
-  
-  Hlonrs
Sampled for Portuguese: 
-  Saeao
-  Msar
-  Saii
Sampled for Russian: 
-  Vaka
-  Sei
-  Eaoun
Sampled for Scottish: 
-  Silae
-  Var
-  Dacanor
Sampled for Spanish: 
-  Mzahra
-  BVaead
-  Si
Sampled for Vietnamese: 
-  kl
-  Medy
-  1aal<jupyter_text>Load saved model<jupyter_code>args_saved= Namespace(
    # Data and Path information
    surname_csv="data/surnames/surnames_with_splits.csv",
    vectorizer_file="vectorizer.json",
    model_state_file="model.pth",
    save_dir="model_storage/ch7/model2_conditioned_surname_generation",
    # Model hyper parameters
    char_embedding_size=32,
    rnn_hidden_size=32,
    # Training hyper parameters
    seed=1337,
    learning_rate=0.001,
    batch_size=128,
    num_epochs=10,
    early_stopping_criteria=5,
    # Runtime options
    catch_keyboard_interrupt=True,
    cuda=True,
    expand_filepaths_to_save_dir=True,
    reload_from_files=True,
    conditioned=True
)
learner_loaded=Learner.learner_from_args(args_saved)
learner_loaded.validate()<jupyter_output>Expanded filepaths: 
	model_storage/ch7/model2_conditioned_surname_generation\vectorizer.json
	model_storage/ch7/model2_conditioned_surname_generation\model.pth
Using CUDA: False
Loading dataset and loading vectorizer
Test loss: 2.776
Test Accuracy: 21.825
{'fraction_non_alphanumeric': 0.08435286542176433, 'fraction_numerical': 0.02189311010946555, 'mean_word_length': 4.15257048092869, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '539961', 'license': 'Apache-2.0', 'n_tokens_mistral': 1290, 'n_tokens_neox': 1219, 'n_words': 204, 'path': 'chapters/chapter_7/7_3_surname_generation/7_3_Model2_Conditioned_Surname_Generation_refactored.ipynb', 'repo_name': 'RRisto/pytorchnlpbook', 'size': '3106'}