当前位置:网站首页>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)
边栏推荐
- 线上问题排查常用命令,总结太全了,建议收藏!!
- 我的驾照考试笔记(1)
- Redis does web page UV statistics
- Addition, Subtraction, Multiplication of Large Integers, Multiplication and Division of Large Integers and Ordinary Integers
- 【多任务优化】DWA、DTP、Gradnorm(CVPR 2019、ECCV 2018、 ICML 2018)
- OSG Notes: Set DO_NOT_COMPUTE_NEAR_FAR to manually calculate far and near planes
- 算法---解码方法(Kotlin)
- 【Dart】dart构造函数学习记录(含dart单例模式写法)
- 有用的网站
- latex论文神器--服务器部署overleaf
猜你喜欢

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

算法---解码方法(Kotlin)

【个人作品】记之-串口日志记录工具

Get started quickly with MongoDB
![[Energy Conservation Institute] Comparative analysis of smart small busbar and column head cabinet solutions in data room](/img/c2/456eec59930321b4f088020905c246.jpg)
[Energy Conservation Institute] Comparative analysis of smart small busbar and column head cabinet solutions in data room

面试突击70:什么是粘包和半包?怎么解决?

基于FPGA的任意字节数(单字节、多字节)的串口(UART)发送(含源码工程)
![[Multi-task model] Progressive Layered Extraction: A Novel Multi-Task Learning Model for Personalized (RecSys'20)](/img/7d/f8f150ad13f4cacc143491fcd8420b.png)
[Multi-task model] Progressive Layered Extraction: A Novel Multi-Task Learning Model for Personalized (RecSys'20)

进行交互或动画时如何选择Visibility, Display, and Opacity

扣减库存方案
随机推荐
Go Atomic
98. Embedded controller EC actual combat EC development board development completed
Convolutional Neural Network (CNN) mnist Digit Recognition - Tensorflow
线程池处理异常的方法
瀚高数据导入
面试突击70:什么是粘包和半包?怎么解决?
小数据如何学习?吉大最新《小数据学习》综述,26页pdf涵盖269页文献阐述小数据学习理论、方法与应用
Buttons with good user experience should not have hover state on mobile phones
[Multi-task learning] Modeling Task Relationships in Multi-task Learning with Multi-gate Mixture-of-Experts KDD18
我的驾照考试笔记(3)
互联网大厂研发流程
漏刻有时文档系统之XE培训系统二次开发配置手册
vant实现Select效果--单选和多选
有用的网站
任务调度线程池基本介绍
tiup mirror grant
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
根据Uniprot ID/PDB ID批处理获取蛋白质.pdb文件
宝塔搭建PESCMS-Ticket开源客服工单系统源码实测
tiup mirror merge