Skip to content

Commit 7567602

Browse files
authored
Add pip install keras-rs to all examples that need it. (#2102)
This is needed for the colabs to work.
1 parent 489038c commit 7567602

27 files changed

+163
-18
lines changed

examples/keras_rs/basic_retrieval.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@
7272
the necessary libraries.
7373
"""
7474

75+
"""shell
76+
pip install -q keras-rs
77+
"""
78+
7579
import os
7680

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

examples/keras_rs/data_parallel_retrieval.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@
2929
JAX as your backend!
3030
"""
3131

32+
"""shell
33+
pip install -q keras-rs
34+
"""
35+
3236
import os
3337

3438
os.environ["KERAS_BACKEND"] = "jax"

examples/keras_rs/dcn.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@
7676
Let's set the backend to JAX, and get our imports sorted.
7777
"""
7878

79+
"""shell
80+
pip install -q keras-rs
81+
"""
82+
7983
import os
8084

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

examples/keras_rs/deep_recommender.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@
7676
affects model performance.
7777
"""
7878

79+
"""shell
80+
pip install -q keras-rs
81+
"""
82+
7983
import os
8084

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

examples/keras_rs/ipynb/basic_retrieval.ipynb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,17 @@
8484
"the necessary libraries."
8585
]
8686
},
87+
{
88+
"cell_type": "code",
89+
"execution_count": 0,
90+
"metadata": {
91+
"colab_type": "code"
92+
},
93+
"outputs": [],
94+
"source": [
95+
"!pip install -q keras-rs"
96+
]
97+
},
8798
{
8899
"cell_type": "code",
89100
"execution_count": 0,

examples/keras_rs/ipynb/data_parallel_retrieval.ipynb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,17 @@
4141
" JAX as your backend!"
4242
]
4343
},
44+
{
45+
"cell_type": "code",
46+
"execution_count": 0,
47+
"metadata": {
48+
"colab_type": "code"
49+
},
50+
"outputs": [],
51+
"source": [
52+
"!pip install -q keras-rs"
53+
]
54+
},
4455
{
4556
"cell_type": "code",
4657
"execution_count": 0,

examples/keras_rs/ipynb/dcn.ipynb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,17 @@
8888
"Let's set the backend to JAX, and get our imports sorted."
8989
]
9090
},
91+
{
92+
"cell_type": "code",
93+
"execution_count": 0,
94+
"metadata": {
95+
"colab_type": "code"
96+
},
97+
"outputs": [],
98+
"source": [
99+
"!pip install -q keras-rs"
100+
]
101+
},
91102
{
92103
"cell_type": "code",
93104
"execution_count": 0,

examples/keras_rs/ipynb/deep_recommender.ipynb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,17 @@
8888
"affects model performance."
8989
]
9090
},
91+
{
92+
"cell_type": "code",
93+
"execution_count": 0,
94+
"metadata": {
95+
"colab_type": "code"
96+
},
97+
"outputs": [],
98+
"source": [
99+
"!pip install -q keras-rs"
100+
]
101+
},
91102
{
92103
"cell_type": "code",
93104
"execution_count": 0,

examples/keras_rs/ipynb/listwise_ranking.ipynb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,17 @@
4545
"Let's begin by importing all the necessary libraries."
4646
]
4747
},
48+
{
49+
"cell_type": "code",
50+
"execution_count": 0,
51+
"metadata": {
52+
"colab_type": "code"
53+
},
54+
"outputs": [],
55+
"source": [
56+
"!pip install -q keras-rs"
57+
]
58+
},
4859
{
4960
"cell_type": "code",
5061
"execution_count": 0,

examples/keras_rs/ipynb/multi_task.ipynb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,17 @@
4949
"Let's start by importing the necessary packages."
5050
]
5151
},
52+
{
53+
"cell_type": "code",
54+
"execution_count": 0,
55+
"metadata": {
56+
"colab_type": "code"
57+
},
58+
"outputs": [],
59+
"source": [
60+
"!pip install -q keras-rs"
61+
]
62+
},
5263
{
5364
"cell_type": "code",
5465
"execution_count": 0,

0 commit comments

Comments
 (0)