当前位置:网站首页>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
边栏推荐
- ue5 小知识 FreezeRendering 查看视锥内渲染的物体
- 2/13 review Backpack + monotonic queue variant
- Database - MySQL storage engine (deadlock)
- Recommendation system (IX) PNN model (product based neural networks)
- View workflow
- VPP performance test
- Dynamic programming (tree DP)
- Etcd database source code analysis -- etcdserver bootstrap initialization storage
- Solve the compilation problem of "c2001: line breaks in constants"
- canal同步mysql数据变化到kafka(centos部署)
猜你喜欢
![[face recognition series] | realize automatic makeup](/img/a5/de98d0522b9dae809cd242aac305b3.jpg)
[face recognition series] | realize automatic makeup

CADD课程学习(7)-- 模拟靶点和小分子相互作用 (柔性对接 AutoDock)

Slow SQL fetching and analysis of MySQL database

Coreldraw2022 new version new function introduction cdr2022

图应用详解

Easyrecovery靠谱不收费的数据恢复电脑软件

Jd.com 2: how to prevent oversold in the deduction process of commodity inventory?

Path of class file generated by idea compiling JSP page

Patent | subject classification method based on graph convolution neural network fusion of multiple human brain maps

R note prophet
随机推荐
P2022 interesting numbers (binary & digit DP)
npm命令--安装依赖包--用法/详解
Redis —— Redis In Action —— Redis 实战—— 实战篇一 —— 基于 Redis 的短信登录功能 —— Redis + Token 的共享 session 应用— 有代码
Implementation of knowledge consolidation source code 1: epoll implementation of TCP server
Practical development of member management applet 06 introduction to life cycle function and user-defined method
View workflow
Brief tutorial for soft exam system architecture designer | general catalog
10個 Istio 流量管理 最常用的例子,你知道幾個?
Yyds dry goods inventory OSI & tcp/ip
SharedPreferences 源码分析
Digital children < daily question> (Digital DP)
Vulnerability discovery - vulnerability probe type utilization and repair of web applications
cdc 能全量拉去oracle 表嘛
[face recognition series] | realize automatic makeup
Solve the compilation problem of "c2001: line breaks in constants"
The most detailed and comprehensive update content and all functions of guitar pro 8.0
E. Best Pair
HotSpot VM
C. The third problem
Dry goods collection | Vulkan game engine video tutorial