Openml python API 的 TensorFlow 扩展
项目描述
OpenML python 的 TensorFlow 扩展
openml -python API 的TensorFlow 扩展。
安装说明:
pip install openml-tensorflow
PyPi 链接https://pypi.org/project/openml-keras/
用法
导入 openML 库
import openml
import openml_tensorflow
创建和编译 keras 模型
model = tensorflow.keras.models.Sequential([
tensorflow.keras.layers.BatchNormalization(),
tensorflow.keras.layers.Dense(units=1024, activation=tensorflow.keras.activations.relu),
tensorflow.keras.layers.Dropout(rate=0.4),
tensorflow.keras.layers.Dense(units=2, activation=tensorflow.keras.activations.softmax),
])
# We will compile using the Adam optimizer while targeting accuracy.
model.compile(optimizer='adam',
loss='sparse_categorical_crossentropy',
metrics=['accuracy'])
从 openML 下载任务并在任务上运行模型。
task = openml.tasks.get_task(3573)
run = openml.runs.run_model_on_task(model, task, avoid_duplicate_runs=False)
run.publish()
print('URL for run: %s/run/%d' % (openml.config.server, run.run_id))
该库目前正在开发中,请在问题部分报告任何错误或功能请求。