当前位置:网站首页>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
边栏推荐
- Basic use of MySQL (it is recommended to read and recite the content)
- hashlimit速率控制
- Knowledge consolidation source code implementation 3: buffer ringbuffer
- npm命令--安装依赖包--用法/详解
- The value of two date types is subtracted and converted to seconds
- Lombok原理和同时使⽤@Data和@Builder 的坑
- HotSpot VM
- canal同步mysql数据变化到kafka(centos部署)
- R note prophet
- Guitar Pro 8.0最详细全面的更新内容及全部功能介绍
猜你喜欢
Easyrecovery靠谱不收费的数据恢复电脑软件
One question per day (Mathematics)
CADD课程学习(8)-- 化合物库虚拟筛选(Virtual Screening)
1291_ Add timestamp function in xshell log
CADD课程学习(7)-- 模拟靶点和小分子相互作用 (柔性对接 AutoDock)
Case of Jiecode empowerment: professional training, technical support, and multiple measures to promote graduates to build smart campus completion system
Meet diverse needs: jetmade creates three one-stop development packages to help efficient development
Deep learning framework installation (tensorflow & pytorch & paddlepaddle)
Easyrecovery reliable and toll free data recovery computer software
Solution of storage bar code management system in food industry
随机推荐
Query the number and size of records in each table in MySQL database
【Try to Hack】john哈希破解工具
[Yu Yue education] reference materials of complex variable function and integral transformation of Northwestern Polytechnic University
Microservice resource address
电脑钉钉怎么调整声音
[try to hack] John hash cracking tool
Can CDC pull the Oracle table in full
2327. Number of people who know secrets (recursive)
Mysql数据库慢sql抓取与分析
Unity screen coordinates ugui coordinates world coordinates conversion between three coordinate systems
Hashlimit rate control
10個 Istio 流量管理 最常用的例子,你知道幾個?
During pycharm debugging, the view is read only and pause the process to use the command line appear on the console input
Basic explanation of turtle module - draw curve
How does computer nail adjust sound
MySQL reported an error datetime (0) null
也算是学习中的小总结
Dynamic programming (tree DP)
The value of two date types is subtracted and converted to seconds
Execution order of scripts bound to game objects