
神经网络
happylife_mini
这个作者很懒,什么都没留下…
展开
-
神经网络学习之卷积神经网络pytorch实现Lenet和Alexnet框架定义
Lenetimport torchfrom torch import nnclass LeNet(nn.Module): def __init__(self): super(LeNet, self).__init__() ''' 这里搭建卷积层,需要按顺序定义卷积层、 激活函数、最大池化层、卷积层、激活函数、最大池化层, 具体形状见测试说明 ''' self.conv = nn.Se原创 2021-11-30 19:53:11 · 1406 阅读 · 0 评论 -
多层感知机的实现tensorflow
1.实现全连接层的前向传播import numpy as npclass FullyConnected: def __init__(self, W, b): r''' 全连接层的初始化。 Parameter: - W: numpy.array, (D_in, D_out) - b: numpy.array, (D_out) ''' self.W = W sel原创 2021-11-30 19:49:39 · 1112 阅读 · 0 评论 -
单隐层前馈神经网络tensorflow实现
# -*- coding: utf-8 -*-import tensorflow as tf# 模拟一个 M-P 神经元class neuron(object): def __init__(self, weight, threshold): self.weight = weight # weight为本神经元的权重,tf.constant self.threshold = threshold # threshold 是这个神经元的阈值,tf.con...原创 2021-11-16 21:02:18 · 961 阅读 · 0 评论