<jupyter_start><jupyter_text><jupyter_code>!pip install -q pytorch-lightning

!rm -r recohut
!git clone --branch v0.0.11.post1 https://github.com/RecoHut-Projects/recohut.git
!pip install -U ./recohut
from recohut.datasets.taobao import TaobaoDataModule
from recohut.models.dcn import DCN
from recohut.trainers.pl_trainer import pl_trainer

import warnings
warnings.filterwarnings('ignore')
params = {'model_id': 'DCN_demo',
              'data_dir': '/content/data',
              'model_root': './checkpoints/',
              'dnn_hidden_units': [64, 64],
              'dnn_activations': "relu",
              'crossing_layers': 3,
              'learning_rate': 1e-3,
              'net_dropout': 0,
              'batch_norm': False,
              'optimizer': 'adamw',
              'task': 'binary_classification',
              'loss': 'binary_crossentropy',
              'metrics': ['logloss', 'AUC'],
              'embedding_dim': 10,
              'batch_size': 64,
              'epochs': 3,
              'shuffle': True,
              'seed': 2019,
              'use_hdf5': True,
              'workers': 1,
              'verbose': 0}
ds = TaobaoDataModule(**params)
ds.prepare_data()
model = DCN(ds.dataset.feature_map, **params)
pl_trainer(model, ds, max_epochs=5)<jupyter_output>GPU available: False, used: False
TPU available: False, using: 0 TPU cores
IPU available: False, using: 0 IPUs

  | Name             | Type           | Params
----------------------------------------------------
0 | embedding_layer  | EmbeddingLayer | 4.8 K 
1 | dnn              | MLP_Layer      | 13.2 K
2 | crossnet         | CrossNet       | 840   
3 | fc               | Linear         | 205   
4 | final_activation | Sigmoid        | 0     
----------------------------------------------------
19.0 K    Trainable params
0         Non-trainable params
19.0 K    Total params
0.076     Total estimated model params size (MB)
{'fraction_non_alphanumeric': 0.16485225505443235, 'fraction_numerical': 0.029030585795749093, 'mean_word_length': 1.7144866385372715, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 1, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '450591', 'license': 'Apache-2.0', 'n_tokens_mistral': 635, 'n_tokens_neox': 590, 'n_words': 145, 'path': 'tutorials/modeling/Training_DCN_model_on_Taobao_CTR_dataset.ipynb', 'repo_name': 'sparsh-ai/recohut', 'size': '1929'}