You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# First, import Keras and define your nn structuresfromtensorflow.kerasimportoptimizersfromtensorflow.keras.layersimportDenselayer_0=Dense(units=6, input_shape=(10,), activation="relu")
layer_1=Dense(units=1, activation="sigmoid")
# Then, add nn layers into Homo-NN model like using Sequential class in Kerasfrompipeline.component.homo_nnimportHomoNN# set parameterhomo_nn_0=HomoNN(name="homo_nn_0", max_iter=10, batch_size=-1, early_stop={"early_stop": "diff", "eps": 0.0001})
homo_nn_0.add(layer_0)
homo_nn_0.add(layer_1)
# Set optimizer and compile Homo-NN modelhomo_nn_0.compile(optimizer=optimizers.Adam(learning_rate=0.05), metrics=["Hinge", "accuracy", "AUC"],
loss="binary_crossentropy")
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
最近有机会接触到FATE,经过初步的了解,感觉FATE是个很棒的系统。因为是新手,还在学习的过程中,有一些问题希望指点一下。目前,我在看 pipeline.md 。这个文档中,有下面的示例代码:
对于最后一行代码,即调用
compile
方法,我在 master 代码分支上进行了查找,在HomoNN
及其父类的定义中并没有找到这个方法的定义。所以想请教一下,这个方法是已经移除了还是定义在其他地方?第二个问题也是关于 [pipeline.md] 中的内容。我注意到pipeline的示例代码也有调用
compile
方法,请问HomoNN
和pipeline
的compile
方法分别是做什么的?分别对算法模型有做何种处理么?两个方法之间有什么关联关系么?以上两个问题麻烦帮忙解答一下,非常感谢!
Beta Was this translation helpful? Give feedback.
All reactions