Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion sqlflow_models/deep_embedding_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,12 @@ def sqlflow_train_loop(self, x, epochs=1, verbose=0):
print('Early stopping since delta_table {} has reached tol {}'.format(delta_percentage, self._tol))
break
idx = index_array[index * self._train_batch_size: min((index + 1) * self._train_batch_size, record_num)]
loss = self.train_on_batch(x=list(all_records_ndarray[idx].T), y=p[idx])
batch_input = all_records_ndarray[idx]
batch_input_dict = {}
for i, feature in enumerate(self._feature_columns):
batch_input_dict[feature.name] = pd.Series(batch_input[:, i])

loss = self.train_on_batch(x=batch_input_dict, y=p[idx])
if ite % 100 == 0:
print('{} Training at iter:{} -> loss:{}.'.format(datetime.now(), ite, loss))
index = index + 1 if (index + 1) * self._train_batch_size <= record_num else 0 # Update index
Expand Down