Skip to content

Commit

Permalink
Update for Keras 3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
drasmuss committed Apr 22, 2024
1 parent 4bff600 commit 95a0978
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .nengobones.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ ci_scripts:
pre_commands:
# We run this ahead of time, otherwise the download progress bar causes
# problems in the notebook rendering
- python -c "import tensorflow as tf; tf.keras.datasets.mnist.load_data()"
- python -c "import tensorflow as tf; keras.datasets.mnist.load_data()"
- template: examples
- template: test
coverage: true
Expand Down
9 changes: 3 additions & 6 deletions docs/basic-usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,11 @@ a 10-dimensional input and a 20-dimensional output.

.. testcode::

from tensorflow.keras import Input, Model
from tensorflow.keras.layers import Dense

inputs = Input((None, 10))
inputs = keras.Input((None, 10))
lmus = lmu_layer(inputs)
outputs = Dense(20)(lmus)
outputs = keras.layers.Dense(20)(lmus)

model = Model(inputs=inputs, outputs=outputs)
model = keras.Model(inputs=inputs, outputs=outputs)


Other parameters
Expand Down
6 changes: 2 additions & 4 deletions docs/examples/psMNIST.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,7 @@
{
"cell_type": "markdown",
"metadata": {},
"source": [
"We now obtain the standard MNIST dataset of handwritten digits from `tf.keras.datasets`."
]
"source": "We now obtain the standard MNIST dataset of handwritten digits from `keras.datasets`."
},
{
"cell_type": "code",
Expand All @@ -95,7 +93,7 @@
"(train_images, train_labels), (\n",
" test_images,\n",
" test_labels,\n",
") = tf.keras.datasets.mnist.load_data()"
") = keras.datasets.mnist.load_data()"
]
},
{
Expand Down
6 changes: 3 additions & 3 deletions keras_lmu/layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
from keras.layers import Layer as BaseRandomLayer


@tf.keras.utils.register_keras_serializable("keras-lmu")
@keras.utils.register_keras_serializable("keras-lmu")
class LMUCell(
DropoutRNNCellMixin, BaseRandomLayer
): # pylint: disable=too-many-ancestors
Expand Down Expand Up @@ -525,7 +525,7 @@ def from_config(cls, config):
return super().from_config(config)


@tf.keras.utils.register_keras_serializable("keras-lmu")
@keras.utils.register_keras_serializable("keras-lmu")
class LMU(keras.layers.Layer): # pylint: disable=too-many-ancestors,abstract-method
"""
A layer of trainable low-dimensional delay systems.
Expand Down Expand Up @@ -793,7 +793,7 @@ def from_config(cls, config):
return super().from_config(config)


@tf.keras.utils.register_keras_serializable("keras-lmu")
@keras.utils.register_keras_serializable("keras-lmu")
class LMUFeedforward(
keras.layers.Layer
): # pylint: disable=too-many-ancestors,abstract-method
Expand Down

0 comments on commit 95a0978

Please sign in to comment.