当前位置:网站首页>Pytorch框架学习记录10——线性层
Pytorch框架学习记录10——线性层
2022-08-01 20:36:00 【柚子Roo】
Pytorch框架学习记录10——线性层
torch.nn.Linear(in_features, out_features, bias=True, device=None, dtype=None)
参数:
- in_features – 每个输入样本的大小
- out_features – 每个输出样本的大小
- bias——如果设置为
False,该层将不会学习附加偏差。默认:True
import torch
from torch import nn
input = torch.tensor([[1, 2, 3],
[1, 0, 3],
[3, 5, 2]], dtype=torch.float32)
input = torch.flatten(input)
class Test(nn.Module):
def __init__(self):
super(Test, self).__init__()
self.fc = nn.Linear(in_features=9, out_features=3)
def forward(self, input):
output = self.fc(input)
return output
test = Test()
output = test(input)
print(output)
边栏推荐
- Little data on how to learn?Jida latest small learning data review, 26 PDF page covers the 269 - page document small data learning theory, method and application are expounded
- Excel advanced drawing techniques, 100 (22) - how to respectively the irregular data
- SIPp installation and use
- 有用的网站
- 【节能学院】推进农业水价综合改革的意见解读
- Postman 批量测试接口详细教程
- [Energy Conservation Institute] Ankerui Food and Beverage Fume Monitoring Cloud Platform Helps Fight Air Pollution
- 【Untitled】
- 使用微信公众号给指定微信用户发送信息
- 线上问题排查常用命令,总结太全了,建议收藏!!
猜你喜欢
随机推荐
【Untitled】
WhatsApp群发实战分享——WhatsApp Business API账号
SIPp 安装及使用
徒步,治好了我的精神内耗
Go Atomic
外骨骼机器人(七):标准步态数据库
【节能学院】推进农业水价综合改革的意见解读
[Energy Conservation Institute] Application of Intelligent Control Device in High Voltage Switchgear
【社媒营销】如何知道自己的WhatsApp是否被屏蔽了?
给定中序遍历和另外一种遍历方法确定一棵二叉树
KDD2022 | Self-Supervised Hypergraph Transformer Recommendation System
用户身份标识与账号体系实践
Imitation cattle forum project
密码学的基础:X.690和对应的BER CER DER编码
The configuration manual for the secondary development of the XE training system of the missing moment document system
Acrel-5010重点用能单位能耗在线监测系统在湖南三立集团的应用
Convolutional Neural Network (CNN) mnist Digit Recognition - Tensorflow
Postman 批量测试接口详细教程
LTE time domain and frequency domain resources
【ES】ES2021 我学不动了,这次只学 3 个。







