Add kwargs to constructor of custom model
parent
ed5c7d6db8
commit
e938df8fb9
|
@ -1054,8 +1054,8 @@
|
|||
"outputs": [],
|
||||
"source": [
|
||||
"class WideAndDeepModel(keras.models.Model):\n",
|
||||
" def __init__(self, units=30, activation=\"relu\"):\n",
|
||||
" super().__init__()\n",
|
||||
" def __init__(self, units=30, activation=\"relu\", **kwargs):\n",
|
||||
" super().__init__(**kwargs)\n",
|
||||
" self.hidden1 = keras.layers.Dense(units, activation=activation)\n",
|
||||
" self.hidden2 = keras.layers.Dense(units, activation=activation)\n",
|
||||
" self.main_output = keras.layers.Dense(1)\n",
|
||||
|
|
Loading…
Reference in New Issue