import paddle
import matplotlib.pyplot as plt
import numpy as np
from PIL import Image
import paddle.nn.functional as F
class MNIST(paddle.nn.Layer):
def __init__(self):
super(MNIST, self).__init__()
self.fc = paddle.nn.Linear(in_features=784, out_features=1)
def forward(self, inputs):
outputs = self.fc(inputs)
return outputs
model = MNIST()
def norm_img(img):
assert len(img.shape) == 3
batch_size, img_h, img_w = img.shape[0], img.shape[1], img.shape[2]
img = img / 255
paddlepaddle的手写体识别
最新推荐文章于 2025-08-30 01:41:55 发布
本文介绍了如何使用PaddlePaddle库构建一个简单的MNIST手写数字识别模型,包括数据预处理、训练过程和模型预测。从加载预训练模型到对新图片进行分类,展示了深度学习基础应用。

最低0.47元/天 解锁文章
2339

被折叠的 条评论
为什么被折叠?



