Skip to content

Instantly share code, notes, and snippets.

@RayWilliam46
Created February 2, 2021 03:40
Show Gist options
  • Save RayWilliam46/f47927bb02cf7804e4e311296357102f to your computer and use it in GitHub Desktop.
Save RayWilliam46/f47927bb02cf7804e4e311296357102f to your computer and use it in GitHub Desktop.
Train weights of classification head with DistilBERT layers frozen
EPOCHS = 6
BATCH_SIZE = 64
NUM_STEPS = len(X_train.index) // BATCH_SIZE
# Train the model
train_history1 = model.fit(
x = [X_train_ids, X_train_attention],
y = y_train.to_numpy(),
epochs = EPOCHS,
batch_size = BATCH_SIZE,
steps_per_epoch = NUM_STEPS,
validation_data = ([X_valid_ids, X_valid_attention], y_valid.to_numpy()),
verbose=2
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment