Skip to content

Commit 02e7be0

Browse files
committed
pt1 dli fix
1 parent 23ed64d commit 02e7be0

File tree

12 files changed

+558
-85
lines changed

12 files changed

+558
-85
lines changed

learntools/deep_learning_intro/dltools.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
from tensorflow import keras
1+
from tf_keras
22
import tensorflow as tf
3-
from tensorflow.keras import layers
3+
from tf_keras import layers
44

55
import numpy as np
66

learntools/deep_learning_intro/ex1.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import numpy as np
22
import tensorflow as tf
3+
import tf_keras
34
from learntools.core import *
45

56
# Using *Red Wine Quality* dataset
@@ -29,16 +30,16 @@ def check(self, input_shape):
2930
class Q2(CodingProblem):
3031
_hint = """Your answer should look something like:
3132
```python
32-
model = keras.Sequential([
33+
model = tf_keras.Sequential([
3334
____
3435
])
3536
```
3637
"""
3738
_solution = CS("""
38-
from tensorflow import keras
39-
from tensorflow.keras import layers
39+
from tf_keras
40+
from tf_keras import layers
4041
41-
model = keras.Sequential([
42+
model = tf_keras.Sequential([
4243
layers.Dense(units=1, input_shape=[{}])
4344
])
4445
""".format(inputs))
@@ -66,7 +67,7 @@ class Q3(CodingProblem):
6667
_hint = "You can get the attribute of an object using the 'dot' notation: like `object.attribute`."
6768
_solution = CS(r"""
6869
# Uncomment if you need the model from the previous question:
69-
# model = keras.Sequential([
70+
# model = tf_keras.Sequential([
7071
# layers.Dense(units=1, input_shape=[11])
7172
# ])
7273

learntools/deep_learning_intro/ex2.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import numpy as np
22
import tensorflow as tf
3-
3+
import tf_keras
44
from learntools.core import *
55

66
# Using *Concrete* dataset
@@ -33,16 +33,16 @@ def check(self, input_shape):
3333
class Q2(CodingProblem):
3434
_hint = """Your answer should look something like:
3535
```python
36-
model = keras.Sequential([
36+
model = tf_keras.Sequential([
3737
____
3838
])
3939
```
4040
"""
4141
_solution = CS("""
42-
from tensorflow import keras
43-
from tensorflow.keras import layers
42+
import tf_keras
43+
from tf_keras import layers
4444
45-
model = keras.Sequential([
45+
model = tf_keras.Sequential([
4646
layers.Dense(512, activation='relu', input_shape=input_shape),
4747
layers.Dense(512, activation='relu'),
4848
layers.Dense(512, activation='relu'),
@@ -85,7 +85,7 @@ class Q3(CodingProblem):
8585
_hidden_units = 32
8686
_hint = """Your model should look something like:
8787
```python
88-
model = keras.Sequential([
88+
model = tf_keras.Sequential([
8989
layers.Dense(____),
9090
layers.Activation(____),
9191
layers.Dense(____),
@@ -95,7 +95,7 @@ class Q3(CodingProblem):
9595
```
9696
"""
9797
_solution = CS("""
98-
model = keras.Sequential([
98+
model = tf_keras.Sequential([
9999
layers.Dense(32, input_shape=[8]),
100100
layers.Activation('relu'),
101101
layers.Dense(32),

learntools/deep_learning_intro/ex5.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
class Q1(CodingProblem):
66
_hint = """Your answer should look something like:
77
```python
8-
model = keras.Sequential([
8+
model = tf_keras.Sequential([
99
# Dense
1010
# Dropout
1111
# Dense
@@ -15,7 +15,7 @@ class Q1(CodingProblem):
1515
```
1616
"""
1717
_solution = CS("""
18-
model = keras.Sequential([
18+
model = tf_keras.Sequential([
1919
layers.Dense(128, activation='relu', input_shape=input_shape),
2020
layers.Dropout(0.3),
2121
layers.Dense(64, activation='relu'),
@@ -65,7 +65,7 @@ class Q2(ThoughtExperiment):
6565
class Q3(CodingProblem):
6666
_hint = """Your answer should look something like:
6767
```python
68-
model = keras.Sequential([
68+
model = tf_keras.Sequential([
6969
# Batch Normalization
7070
# Dense
7171
# Batch Normalization
@@ -78,7 +78,7 @@ class Q3(CodingProblem):
7878
```
7979
"""
8080
_solution = CS("""
81-
model = keras.Sequential([
81+
model = tf_keras.Sequential([
8282
layers.BatchNormalization(input_shape=input_shape),
8383
layers.Dense(512, activation='relu'),
8484
layers.BatchNormalization(),

learntools/deep_learning_intro/ex6.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ class Q1(CodingProblem):
2020
```
2121
"""
2222
_solution = CS("""
23-
from tensorflow import keras
24-
from tensorflow.keras import layers
23+
import tf_keras
24+
from tf_keras import layers
2525
26-
model = keras.Sequential([
26+
model = tf_keras.Sequential([
2727
layers.BatchNormalization(input_shape=input_shape),
2828
layers.Dense(256, activation='relu'),
2929
layers.BatchNormalization(),

0 commit comments

Comments
 (0)