当前位置:网站首页>It is also a small summary in learning
It is also a small summary in learning
2022-07-06 04:34:00 【Cheng Wazi】
# The following code is in jupyter notebook Running in
import torch
c=torch.arange(20).reshape(2,5,2)
c,c.sum(axis=0) #(2,5,2) first 2 disappear , Two (5,2) Add up
# Running results
(tensor([[[ 0, 1],
[ 2, 3],
[ 4, 5],
[ 6, 7],
[ 8, 9]],
[[10, 11],
[12, 13],
[14, 15],
[16, 17],
[18, 19]]]),
tensor([[10, 12],
[14, 16],
[18, 20],
[22, 24],
[26, 28]]))
c=torch.arange(20).reshape(2,5,2)
c,c.sum(axis=1) #(2,5,2) the second 5 disappear , Two (5,2) become (1,2) Add it up
# Running results
(tensor([[[ 0, 1],
[ 2, 3],
[ 4, 5],
[ 6, 7],
[ 8, 9]],
[[10, 11],
[12, 13],
[14, 15],
[16, 17],
[18, 19]]]),
tensor([[20, 25],
[70, 75]]))
c=torch.arange(20).reshape(2,5,2)
c,c.sum(axis=2) #(2,5,2) Third 2 disappear , become (2,5)
# Running results
(tensor([[[ 0, 1],
[ 2, 3],
[ 4, 5],
[ 6, 7],
[ 8, 9]],
[[10, 11],
[12, 13],
[14, 15],
[16, 17],
[18, 19]]]),
tensor([[ 1, 5, 9, 13, 17],
[21, 25, 29, 33, 37]]))
c=torch.arange(20).reshape(2,5,2)
c,c.sum(axis=1,keepdims=True).shape
# Run a screenshot
(tensor([[[ 0, 1],
[ 2, 3],
[ 4, 5],
[ 6, 7],
[ 8, 9]],
[[10, 11],
[12, 13],
[14, 15],
[16, 17],
[18, 19]]]),
torch.Size([2, 1, 2]))
Steps of linear regression model
1. Generate data set .
2. Reading data sets .
3. Initialize model parameters .
4. Defining models
5. Loss function
6. optimization algorithm
7. Training
边栏推荐
- 捷码赋能案例:专业培训、技术支撑,多措并举推动毕业生搭建智慧校园毕设系统
- PTA tiantisai l1-078 teacher Ji's return (15 points) detailed explanation
- HotSpot VM
- VPP性能测试
- Certbot failed to update certificate solution
- Sqlserver query results are not displayed in tabular form. How to modify them
- ue5 小知识 FreezeRendering 查看视锥内渲染的物体
- Can CDC pull the Oracle table in full
- QML和QWidget混合开发(初探)
- 729. My schedule I (set or dynamic open point segment tree)
猜你喜欢
VNCTF2022 WriteUp
Mysql数据库慢sql抓取与分析
Database - MySQL storage engine (deadlock)
Vulnerability discovery - vulnerability probe type utilization and repair of web applications
Practical development of member management applet 06 introduction to life cycle function and user-defined method
Stable Huawei micro certification, stable Huawei cloud database service practice
1291_ Add timestamp function in xshell log
How many of the 10 most common examples of istio traffic management do you know?
ETCD数据库源码分析——etcdserver bootstrap初始化存储
MySQL learning record 13 database connection pool, pooling technology, DBCP, c3p0
随机推荐
Fedora/rehl installation semanage
How many of the 10 most common examples of istio traffic management do you know?
Microservice resource address
cdc 能全量拉去oracle 表嘛
P2022 有趣的数(二分&数位dp)
729. 我的日程安排表 I(set or 动态开点线段树)
CADD课程学习(8)-- 化合物库虚拟筛选(Virtual Screening)
How to solve the problem of slow downloading from foreign NPM official servers—— Teach you two ways to switch to Taobao NPM image server
[Zhao Yuqiang] deploy kubernetes cluster with binary package
View 工作流程
NPM command -- install dependent packages -- Usage / explanation
Sentinel sliding window traffic statistics
Lambda expression learning
Path of class file generated by idea compiling JSP page
In depth MySQL transactions, stored procedures and triggers
Yyds dry inventory automatic lighting system based on CC2530 (ZigBee)
C. The Third Problem(找规律)
捷码赋能案例:专业培训、技术支撑,多措并举推动毕业生搭建智慧校园毕设系统
Mixed development of QML and QWidget (preliminary exploration)
Script lifecycle