【发布时间】:2020-08-07 16:15:44
【问题描述】:
我知道可以通过多次调用model.predict() 并测量返回值的平均值来实现蒙特卡洛辍学。但是,我想知道是否可以通过继承Models 类的tensorflow.keras 来实现它?
使用通过子类化Models 类来实现模型的更典型方式提供了对轻松加载和保存 Keras 模型的支持,无需任何其他代码,然后在运行时(一次)调用 predict。这在使用 Tensorflow Serving 时可能特别有用,但在通过其他 Python 脚本加载它时也已经增加了一些舒适度。 (例如,比较多个不同的模型时。)
【问题讨论】:
标签: python tensorflow keras tensorflow2.x