Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WND训练应该有点问题 #83

Open
Adam86546853 opened this issue Apr 14, 2023 · 0 comments
Open

WND训练应该有点问题 #83

Adam86546853 opened this issue Apr 14, 2023 · 0 comments

Comments

@Adam86546853
Copy link

  1. 数据处理: feature_columns = [sparseFeature(feat, len(fea_map[feat]) + 1 if feat in sparse_features else n_bins+1,embed_dim=embed_dim) for feat in features] dense特征离散化后传分桶个数

  2. 数据集处理这块
    def mnist_dataset(batch_size):
    (x_train, y_train), _ = tf.keras.datasets.mnist.load_data()

The x arrays are in uint8 and have values in the [0, 255] range.

You need to convert them to float32 with values in the [0, 1] range.

x_train = x_train / np.float32(255)
y_train = y_train.astype(np.int64)
train_dataset = tf.data.Dataset.from_tensor_slices(
(x_train, y_train)).shuffle(60000).repeat().batch(batch_size)
return train_dataset
dataset 对分布式更友好,特别是custom train step

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant