From 6718ae2636e3b78299601b6ada886b749b401d8f Mon Sep 17 00:00:00 2001 From: Jake VanderPlas Date: Fri, 5 Aug 2022 16:24:11 -0700 Subject: [PATCH] Rename jax.experimental.optimizers -> jax.example_libraries.optimizers Why? The former name has been deprecated since JAX version 0.2.25, released in November 2021 (see https://github.com/google/jax/blob/main/CHANGELOG.md#jax-0225-nov-10-2021), and will soon be removed. PiperOrigin-RevId: 465670868 --- research/instahide_attack_2020/step_5_reconstruct.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/research/instahide_attack_2020/step_5_reconstruct.py b/research/instahide_attack_2020/step_5_reconstruct.py index dcbf6f8..ade5903 100644 --- a/research/instahide_attack_2020/step_5_reconstruct.py +++ b/research/instahide_attack_2020/step_5_reconstruct.py @@ -25,7 +25,7 @@ import jax import collections from PIL import Image -import jax.experimental.optimizers +import jax.example_libraries.optimizers import matplotlib.pyplot as plt @@ -109,7 +109,8 @@ def run(): lams = np.array(lambdas) # Use Adam, because thinking hard is overrated we have magic pixie dust. - init_1, opt_update_1, get_params_1 = jax.experimental.optimizers.adam(.01) + init_1, opt_update_1, get_params_1 = \ + jax.example_libraries.optimizers.adam(.01) @jax.jit def update_1(i, opt_state, gs): return opt_update_1(i, gs, opt_state)