Skip to content

Commit

Permalink
ADD: eagerly exec for SimpleMNL
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentAuriau committed Nov 29, 2024
1 parent 42fa7cd commit d54065b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/integration_tests/models/test_simple_mnl.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""Tests SimpleMNL."""

import tensorflow as tf

from choice_learn.datasets import load_swissmetro
from choice_learn.models import SimpleMNL

Expand All @@ -18,10 +20,11 @@ def test_simple_mnl_lbfgs_fit_with_lbfgs():

def test_simple_mnl_lbfgs_fit_with_adam():
"""Tests that SimpleMNL can fit with Adam."""
tf.config.run_functions_eagerly(True)
global dataset

model = SimpleMNL(epochs=20, optimizer="adam", batch_size=256)
model.fit(dataset)
model.fit(dataset, get_report=True)
model.evaluate(dataset)
assert model.evaluate(dataset) < 1.0

Expand Down

0 comments on commit d54065b

Please sign in to comment.