97
97
" self.b = self.add_weight(shape=(units,), initializer=\" zeros\" , trainable=True)\n " ,
98
98
" \n " ,
99
99
" def call(self, inputs):\n " ,
100
- " return ops.matmul(inputs, self.w) + self.b\n " ,
101
- " "
100
+ " return ops.matmul(inputs, self.w) + self.b\n "
102
101
]
103
102
},
104
103
{
246
245
" self.b = self.add_weight(shape=(units,), initializer=\" zeros\" , trainable=True)\n " ,
247
246
" \n " ,
248
247
" def call(self, inputs):\n " ,
249
- " return ops.matmul(inputs, self.w) + self.b\n " ,
250
- " "
248
+ " return ops.matmul(inputs, self.w) + self.b\n "
251
249
]
252
250
},
253
251
{
289
287
" )\n " ,
290
288
" \n " ,
291
289
" def call(self, inputs):\n " ,
292
- " return ops.matmul(inputs, self.w) + self.b\n " ,
293
- " "
290
+ " return ops.matmul(inputs, self.w) + self.b\n "
294
291
]
295
292
},
296
293
{
390
387
" The `keras.ops` namespace gives you access to:\n " ,
391
388
" \n " ,
392
389
" - The NumPy API, e.g. `ops.matmul`, `ops.sum`, `ops.reshape`, `ops.stack`, etc.\n " ,
393
- " - Neural networks-specific APIs such as `ops.softmax`, `ops` .conv`, `ops.binary_crossentropy`, `ops.relu`, etc.\n " ,
390
+ " - Neural networks-specific APIs such as `ops.softmax`, `ops.conv`, `ops.binary_crossentropy`, `ops.relu`, etc.\n " ,
394
391
" \n " ,
395
392
" You can also use backend-native APIs in your layers (such as `tf.nn` functions),\n " ,
396
393
" but if you do this, then your layer will only be usable with the backend in question.\n " ,
465
462
" \n " ,
466
463
" def call(self, inputs):\n " ,
467
464
" self.add_loss(self.rate * ops.mean(inputs))\n " ,
468
- " return inputs\n " ,
469
- " "
465
+ " return inputs\n "
470
466
]
471
467
},
472
468
{
742
738
" return keras.random.dropout(\n " ,
743
739
" inputs, rate=self.rate, seed=self.seed_generator\n " ,
744
740
" )\n " ,
745
- " return inputs\n " ,
746
- " "
741
+ " return inputs\n "
747
742
]
748
743
},
749
744
{
947
942
" z_log_var - ops.square(z_mean) - ops.exp(z_log_var) + 1\n " ,
948
943
" )\n " ,
949
944
" self.add_loss(kl_loss)\n " ,
950
- " return reconstructed\n " ,
951
- " "
945
+ " return reconstructed\n "
952
946
]
953
947
},
954
948
{
1010
1004
},
1011
1005
"nbformat" : 4 ,
1012
1006
"nbformat_minor" : 0
1013
- }
1007
+ }
0 commit comments