Issue replicating AutoKeras StructuredDataClassifier
I have a model that I generated using AutoKeras and I want to replicate the model so that I can construct it with keras tuner to do further hyperparameter tuning. But I am running into issues replicating the model. 856
The model summary of the autokeras model is: ``` Model: "model"
Layer (type) Output Shape Param #
input_1 (InputLayer) [(None, 11)] 0
multi_category_encoding (Mul (None, 11) 0
normalization (Normalization (None, 11) 23
dense (Dense) (None, 16) 192
re_lu (ReLU) (None, 16) 0
dense_1 (Dense) (None, 32) 544
re_lu_1 (ReLU) (None, 32) 0
dense_2 (Dense) (None, 3) 99
classification_head_1 (Softm (None, 3) 0
Total params: 858 Trainable params: 835 Non-trainable params: 23 Layer config {'batch_input_shape': (None, 11), 'dtype': 'string', 'sparse': False, 'ragged': False, 'name': 'input_1'} {'name': 'multi_category_encoding', 'trainable': True, 'dtype': 'float32', 'encoding': ListWrapper(['int', 'int', 'int', 'int', 'int', 'int', 'int', 'int', 'int', 'int', 'int'])} {'name': 'normalization', 'trainable': True, 'dtype': 'float32', 'axis': (-1,)} {'name': 'dense', 'trainable': True, 'dtype': 'float32', 'units': 16, 'activation': 'linear', 'use_bias': True, 'kernel_initializer': {'class_name': 'GlorotUniform', 'config': {'seed': None}}, 'bias_initializer': {'class_name': 'Zeros', 'config': {}}, 'kernel_regularizer': None, 'bias_regularizer': None, 'activity_regularizer': None, 'kernel_constraint': None, 'bias_constraint': None} {'name': 're_lu', 'trainable': True, 'dtype': 'float32', 'max_value': None, 'negative_slope': array(0., dtype=float32), 'threshold': array(0., dtype=float32)} {'name': 'dense_1', 'trainable': True, 'dtype': 'float32', 'units': 32, 'activation': 'linear', 'use_bias': True, 'kernel_initializer': {'class_name': 'GlorotUniform', 'config': {'seed': None}}, 'bias_initializer': {'class_name': 'Zeros', 'config': {}}, 'kernel_regularizer': None, 'bias_regularizer': None, 'activity_regularizer': None, 'kernel_constraint': None, 'bias_constraint': None} {'name': 're_lu_1', 'trainable': True, 'dtype': 'float32', 'max_value': None, 'negative_slope': array(0., dtype=float32), 'threshold': array(0., dtype=float32)} {'name': 'dense_2', 'trainable': True, 'dtype': 'float32', 'units': 3, 'activation': 'linear', 'use_bias': True, 'kernel_initializer': {'class_name': 'GlorotUniform', 'config': {'seed': None}}, 'bias_initializer': {'class_name': 'Zeros', 'config': {}}, 'kernel_regularizer': None, 'bias_regularizer': None, 'activity_regularizer': None, 'kernel_constraint': None, 'bias_constraint': None} {'name': 'classification_head_1', 'trainable': True, 'dtype': 'float32', 'axis': -1} `` My training data is a dataframe that's converted to string type with both numerical and categorical data. Since the output is softmax i usedLabelBinarizer` to convert the target classes.
To make sure the model was replicated properly, i used keras.clone_model. The optimizer and loss function follows from the original model. 695