我正在尝试使用dist-keras实现自动编码器来重建76个输入要素。
这是我的代码:
features = ['f1', 'f2', ...., 'f76']
assembler = VectorAssembler(inputCols=features, outputCol="features")
dataset = assembler.transform(df)
scaler = MinMaxScaler(inputCol="features", outputCol="features_scaled")
scaler_model = scaler.fit(dataset)
dataset = scaler_model.transform(dataset)
nb_features = len(features)
model = Sequential()
model.add(Dense(50, activation='relu', input_shape=(nb_features,)))
model.add(Dense(nb_features, activation='sigmoid'))
model.summary()
Layer (type) Output Shape Param #
=================================================================
dense_1 (Dense) (None, 50) 3850
_________________________________________________________________
dense_2 (Dense) (None, 76) 3876
=================================================================
Total params: 7,726
Trainable params: 7,726
Non-trainable params: 0
_________________________________________________________________
trainer = SingleTrainer(keras_model=model, worker_optimizer="adam",
loss="mae", features_col="features_scaled",
label_col="features_scaled", num_epoch=5, batch_size=32)
trained_model = trainer.train(dataset)
培训时间超过10小时且仍在运行!我错过了什么吗?