Skip to content

Commit

Permalink
Minor clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
abheesht17 committed Jan 30, 2025
1 parent 9fc1381 commit 18d3169
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions examples/sequential_retrieval.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@
BATCH_SIZE = 2048
TEST_BATCH_SIZE = 2048
EMBEDDING_DIM = 128
NUM_EPOCHS = 10
LEARNING_RATE = 0.05

"""
## Dataset
Expand Down Expand Up @@ -372,8 +374,8 @@ def compute_loss(self, x, y, y_pred, sample_weight, training=True):

# Compile.
learning_rate = keras.optimizers.schedules.PolynomialDecay(
0.05,
decay_steps=10 * 30,
LEARNING_RATE,
decay_steps=train_ds.cardinality() * NUM_EPOCHS,
end_learning_rate=0.0,
)
model.compile(optimizer=keras.optimizers.AdamW(learning_rate=learning_rate))
Expand All @@ -382,7 +384,7 @@ def compute_loss(self, x, y, y_pred, sample_weight, training=True):
model.fit(
train_ds,
validation_data=test_ds,
epochs=30,
epochs=NUM_EPOCHS,
)

"""
Expand Down

0 comments on commit 18d3169

Please sign in to comment.