Skip to content

Add pip install keras-rs to all examples that need it. #2102

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

Merged
merged 1 commit into from
May 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions examples/keras_rs/basic_retrieval.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@
the necessary libraries.
"""

"""shell
pip install -q keras-rs
"""

import os

os.environ["KERAS_BACKEND"] = "jax" # `"tensorflow"`/`"torch"`
Expand Down
4 changes: 4 additions & 0 deletions examples/keras_rs/data_parallel_retrieval.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
JAX as your backend!
"""

"""shell
pip install -q keras-rs
"""

import os

os.environ["KERAS_BACKEND"] = "jax"
Expand Down
4 changes: 4 additions & 0 deletions examples/keras_rs/dcn.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@
Let's set the backend to JAX, and get our imports sorted.
"""

"""shell
pip install -q keras-rs
"""

import os

os.environ["KERAS_BACKEND"] = "jax" # `"tensorflow"`/`"torch"`
Expand Down
4 changes: 4 additions & 0 deletions examples/keras_rs/deep_recommender.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@
affects model performance.
"""

"""shell
pip install -q keras-rs
"""

import os

os.environ["KERAS_BACKEND"] = "jax" # `"tensorflow"`/`"torch"`
Expand Down
11 changes: 11 additions & 0 deletions examples/keras_rs/ipynb/basic_retrieval.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,17 @@
"the necessary libraries."
]
},
{
"cell_type": "code",
"execution_count": 0,
"metadata": {
"colab_type": "code"
},
"outputs": [],
"source": [
"!pip install -q keras-rs"
]
},
{
"cell_type": "code",
"execution_count": 0,
Expand Down
11 changes: 11 additions & 0 deletions examples/keras_rs/ipynb/data_parallel_retrieval.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,17 @@
" JAX as your backend!"
]
},
{
"cell_type": "code",
"execution_count": 0,
"metadata": {
"colab_type": "code"
},
"outputs": [],
"source": [
"!pip install -q keras-rs"
]
},
{
"cell_type": "code",
"execution_count": 0,
Expand Down
11 changes: 11 additions & 0 deletions examples/keras_rs/ipynb/dcn.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,17 @@
"Let's set the backend to JAX, and get our imports sorted."
]
},
{
"cell_type": "code",
"execution_count": 0,
"metadata": {
"colab_type": "code"
},
"outputs": [],
"source": [
"!pip install -q keras-rs"
]
},
{
"cell_type": "code",
"execution_count": 0,
Expand Down
11 changes: 11 additions & 0 deletions examples/keras_rs/ipynb/deep_recommender.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,17 @@
"affects model performance."
]
},
{
"cell_type": "code",
"execution_count": 0,
"metadata": {
"colab_type": "code"
},
"outputs": [],
"source": [
"!pip install -q keras-rs"
]
},
{
"cell_type": "code",
"execution_count": 0,
Expand Down
11 changes: 11 additions & 0 deletions examples/keras_rs/ipynb/listwise_ranking.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,17 @@
"Let's begin by importing all the necessary libraries."
]
},
{
"cell_type": "code",
"execution_count": 0,
"metadata": {
"colab_type": "code"
},
"outputs": [],
"source": [
"!pip install -q keras-rs"
]
},
{
"cell_type": "code",
"execution_count": 0,
Expand Down
11 changes: 11 additions & 0 deletions examples/keras_rs/ipynb/multi_task.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,17 @@
"Let's start by importing the necessary packages."
]
},
{
"cell_type": "code",
"execution_count": 0,
"metadata": {
"colab_type": "code"
},
"outputs": [],
"source": [
"!pip install -q keras-rs"
]
},
{
"cell_type": "code",
"execution_count": 0,
Expand Down
11 changes: 11 additions & 0 deletions examples/keras_rs/ipynb/sas_rec.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,17 @@
"Let's begin by importing all the necessary libraries."
]
},
{
"cell_type": "code",
"execution_count": 0,
"metadata": {
"colab_type": "code"
},
"outputs": [],
"source": [
"!pip install -q keras-rs"
]
},
{
"cell_type": "code",
"execution_count": 0,
Expand Down
12 changes: 1 addition & 11 deletions examples/keras_rs/ipynb/scann.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,7 @@
},
"outputs": [],
"source": [
"# ruff: noqa: E402"
]
},
{
"cell_type": "code",
"execution_count": 0,
"metadata": {
"colab_type": "code"
},
"outputs": [],
"source": [
"!pip install -q keras-rs\n",
"!pip install -q scann"
]
},
Expand Down
11 changes: 11 additions & 0 deletions examples/keras_rs/ipynb/sequential_retrieval.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,17 @@
"the necessary libraries."
]
},
{
"cell_type": "code",
"execution_count": 0,
"metadata": {
"colab_type": "code"
},
"outputs": [],
"source": [
"!pip install -q keras-rs"
]
},
{
"cell_type": "code",
"execution_count": 0,
Expand Down
4 changes: 4 additions & 0 deletions examples/keras_rs/listwise_ranking.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
Let's begin by importing all the necessary libraries.
"""

"""shell
pip install -q keras-rs
"""

import os

os.environ["KERAS_BACKEND"] = "jax" # `"tensorflow"`/`"torch"`
Expand Down
5 changes: 5 additions & 0 deletions examples/keras_rs/md/basic_retrieval.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ Let's begin by choosing JAX as the backend we want to run on, and import all
the necessary libraries.


```python
!pip install -q keras-rs
```


```python
import os

Expand Down
5 changes: 5 additions & 0 deletions examples/keras_rs/md/data_parallel_retrieval.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ Before we begin, let's note down a few things:
JAX as your backend!


```python
!pip install -q keras-rs
```


```python
import os

Expand Down
5 changes: 5 additions & 0 deletions examples/keras_rs/md/dcn.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ learnt important feature crosses.
Let's set the backend to JAX, and get our imports sorted.


```python
!pip install -q keras-rs
```


```python
import os

Expand Down
5 changes: 5 additions & 0 deletions examples/keras_rs/md/deep_recommender.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ We'll do this by building progressively more complex models to see how this
affects model performance.


```python
!pip install -q keras-rs
```


```python
import os

Expand Down
5 changes: 5 additions & 0 deletions examples/keras_rs/md/listwise_ranking.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ goal is to minimize the number of incorrectly ordered pairs.
Let's begin by importing all the necessary libraries.


```python
!pip install -q keras-rs
```


```python
import os

Expand Down
5 changes: 5 additions & 0 deletions examples/keras_rs/md/multi_task.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ user to a movie.
Let's start by importing the necessary packages.


```python
!pip install -q keras-rs
```


```python
import os

Expand Down
5 changes: 5 additions & 0 deletions examples/keras_rs/md/sas_rec.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ for the same sequential recommendation task.
Let's begin by importing all the necessary libraries.


```python
!pip install -q keras-rs
```


```python
import os

Expand Down
6 changes: 1 addition & 5 deletions examples/keras_rs/md/scann.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,7 @@ also set the backend to JAX.


```python
# ruff: noqa: E402
```


```python
!pip install -q keras-rs
!pip install -q scann
```

Expand Down
5 changes: 5 additions & 0 deletions examples/keras_rs/md/sequential_retrieval.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ Let's begin by choosing JAX as the backend we want to run on, and import all
the necessary libraries.


```python
!pip install -q keras-rs
```


```python
import os

Expand Down
4 changes: 4 additions & 0 deletions examples/keras_rs/multi_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
Let's start by importing the necessary packages.
"""

"""shell
pip install -q keras-rs
"""

import os

os.environ["KERAS_BACKEND"] = "jax" # `"tensorflow"`/`"torch"`
Expand Down
4 changes: 4 additions & 0 deletions examples/keras_rs/sas_rec.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
Let's begin by importing all the necessary libraries.
"""

"""shell
pip install -q keras-rs
"""

import os

os.environ["KERAS_BACKEND"] = "jax" # `"tensorflow"`/`"torch"`
Expand Down
3 changes: 1 addition & 2 deletions examples/keras_rs/scann.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,8 @@
also set the backend to JAX.
"""

# ruff: noqa: E402

"""shell
pip install -q keras-rs
pip install -q scann
"""

Expand Down
4 changes: 4 additions & 0 deletions examples/keras_rs/sequential_retrieval.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
the necessary libraries.
"""

"""shell
pip install -q keras-rs
"""

import os

os.environ["KERAS_BACKEND"] = "jax" # `"tensorflow"`/`"torch"`
Expand Down