Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update tutorials for keras 3 #120

Merged
merged 9 commits into from
Dec 13, 2023
Merged

Conversation

nhuet
Copy link
Contributor

@nhuet nhuet commented Dec 4, 2023

  • Use keras3 decomon version (when installing on colab)
  • Adapt code in notebooks
    • tensorflow.keras -> keras
    • K.set_value(var, val) -> var.assign(val)
    • model.compile() must give list for metrics arg
    • variable.value() -> variable.numpy()
  • Fix decomon clone() with backbounds already defined (and a test to check it outside tutorials). This is used by tutorial 3 about adversarial attack.

nhuet added 9 commits December 4, 2023 12:45
- tensorflow.keras -> keras
- K.set_value(var, val) -> var.assign(val)
- model.compile() must give list for metrics arg
- variable.value() -> variable.numpy()
Tutorial 3 was crashing without having a unitary test crashing because
we do not test clone method with given back_bounds
0 * C[:,0] was giving a sparse tensor (why?) which leads to an error.
Using zeros_like() instead solves the issue (stay a non-sparse tensor)
This is the new minimum version of python for decomon beacause of keras
3.0
Even though this is actually a Functional model, it does not use its
get_config() method because it is checked inside it that the __init__
method has the same signature as a functional model.

Thus we enforce the get_config() from Functional by converting the model
to a mere keras functional model and then add the properties specific to
decomon.

We add a test for it.
@ducoffeM ducoffeM merged commit ce6b566 into airbus:keras3 Dec 13, 2023
10 checks passed
@nhuet nhuet deleted the nb_keras_nightly branch January 11, 2024 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants