我遇到了一些以tensorflow.python.data.ops.dataset_ops.PrefetchDataset. 如果我说实话的话。我真的不明白这是如何打破过去的data。ops、dataset_ops和一般意味着什么PrefetchDataset(如果有的话)
在此处的代码中: https: //www.kaggle.com/ryanholbrook/detecting-the-higgs-boson-with-tpus
在编译模型之前,使用以下代码制作模型:
with strategy.scope():
# Wide Network
wide = keras.experimental.LinearModel()
# Deep Network
inputs = keras.Input(shape=[28])
x = dense_block(UNITS, ACTIVATION, DROPOUT)(inputs)
x = dense_block(UNITS, ACTIVATION, DROPOUT)(x)
x = dense_block(UNITS, ACTIVATION, DROPOUT)(x)
x = dense_block(UNITS, ACTIVATION, DROPOUT)(x)
x = dense_block(UNITS, ACTIVATION, DROPOUT)(x)
outputs = layers.Dense(1)(x)
deep = keras.Model(inputs=inputs, outputs=outputs)
# Wide and Deep Network
wide_and_deep = keras.experimental.WideDeepModel(
linear_model=wide,
dnn_model=deep,
activation='sigmoid',
)
Run Code Online (Sandbox Code Playgroud)
我不明白with strategy.scope()这里有什么作用以及它是否以任何方式影响模型。它到底有什么作用?
将来我怎样才能弄清楚这是做什么的?我需要寻找哪些资源才能解决这个问题?