Skip to content

Commit

Permalink
Internal change
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 375132461
  • Loading branch information
achoum authored and copybara-github committed May 21, 2021
1 parent 87fda83 commit 54998fa
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 27 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# Changelog

## 0.1.4 - ????
## 0.1.4 - 2021-05-21

### Features

- Stop the training when interrupting a colab cell / typing ctrl-c.
- `model.fit` support training callbacks and a validation dataset.

### Bug fix

Expand Down
2 changes: 1 addition & 1 deletion configure/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from setuptools.command.install import install
from setuptools.dist import Distribution

_VERSION = "0.1.3"
_VERSION = "0.1.4"

with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
Expand Down
23 changes: 0 additions & 23 deletions documentation/known_issues.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,29 +51,6 @@ numerical/categorical features would be 4 GB in memory.
* Train a manual ensemble on slices of the dataset, i.e. train N models on N
slices of data, and average the predictions.

## No support for training callbacks.

Training callbacks will not get the expected metrics passed to on_epoch_end
since TF-DF algorithms are trained for only one epoch, and the validation
data is evaluated before the model is trained. Evaluation callbacks are
supported.

**Workaround**

By design TF-DF algorithms train for only one epoch, so callbacks that override
on_epoch_end can be instantiated and called manually with the metrics from
model.evaluate(). Specifically:

```diff {.bad}
- cb = tf.keras.callbacks.Callback()
- model.fit(train_ds, validation_data=val_ds, callbacks=[cb])
```

```diff {.good}
+ model.fit(train_ds)
+ cb.on_epoch_end(epoch=1, logs=model.evaluate(val_ds, ...))
```

## No support for GPU / TPU.

TF-DF does not support GPU or TPU training. Compiling with AVX instructions,
Expand Down
2 changes: 1 addition & 1 deletion tensorflow_decision_forests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"""

__version__ = "0.1.3"
__version__ = "0.1.4"
__author__ = "Mathieu Guillame-Bert"

from tensorflow_decision_forests import keras
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ std::atomic<bool> stop_training;
void (*previous_signal_handler)(int);

// Number of learners training.
std::atomic<int> active_learners = 0;
std::atomic<int> active_learners(0);

void StopTrainingSignalHandler(int signal) { stop_training = true; }
} // namespace
Expand Down

0 comments on commit 54998fa

Please sign in to comment.