Skip to main content

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))

该库目前正在开发中,请在问题部分报告任何错误或功能请求。

项目详情


下载文件

下载适用于您平台的文件。如果您不确定要选择哪个,请了解有关安装包的更多信息。

源分布

openml-tensorflow-0.0.2.tar.gz (13.4 kB 查看哈希

已上传 source