keras Python深度学习封装库 60k stars
keras简介
keras,Python第三方深度学习库,其中Keras 3是Keras API的一个新的多后端实现,支持TensorFlow、JAX和PyTorch,可以快速上手的神经网络,可添加GPU支持。
keras应用实例
import numpy as np
import os
os.environ["KERAS_BACKEND"] = "jax"
import keras
#A first example: A MNIST convnet
# Load the data and split it between train and test sets
(x_train, y_train), (x_test, y_test) = keras.datasets.mnist.load_data()
# Scale images to the [0, 1] range
x_train = x_train.astype("float32") / 255
x_test = x_test.astype("float32") / 255
# Make sure images have shape (28, 28, 1)
x_train = np.expand_dims(x_train, -1)
x_test = np.expand_dims(x_test, -1)
print("x_train shape:", x_train.shape)
print("y_train shape:", y_train.shape)
print(x_train.shape[0], "train samples")
print(x_test.shape[0], "test samples")
keras Github统计数据
Apache-2.0 license
Github 60k stars
keras安装命令
pip install keras --upgrade
Python版本要求
keras 3.0.1 Requires: Python >=3.9(数据来源:pypi)
免责声明:内容编辑自网络,仅供参考,不保证正确性,不作任何决策依据!!以上数据皆截止于博文的写稿日期。