当前位置:网站首页>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
边栏推荐
- Etcd database source code analysis -- etcdserver bootstrap initialization storage
- Easyrecovery reliable and toll free data recovery computer software
- English Vocabulary - life scene memory method
- . Net interprocess communication
- [tomato assistant installation]
- hashlimit速率控制
- Microservice resource address
- P2102 floor tile laying (DFS & greed)
- Several important classes in unity
- Use sentinel to interface locally
猜你喜欢

Comprehensive ability evaluation system

Database - MySQL storage engine (deadlock)

Figure application details

Digital children < daily question> (Digital DP)

CADD course learning (7) -- Simulation of target and small molecule interaction (flexible docking autodock)

Use sentinel to interface locally
![[Chongqing Guangdong education] engineering fluid mechanics reference materials of southwestjiaotonguniversity](/img/ac/93a64e59592e3d083a771b993d6884.jpg)
[Chongqing Guangdong education] engineering fluid mechanics reference materials of southwestjiaotonguniversity

MLAPI系列 - 04 - 网络变量和网络序列化【网络同步】

ETCD数据库源码分析——etcdserver bootstrap初始化存储

Mysql database storage engine
随机推荐
hashlimit速率控制
P2102 地砖铺设(dfs&贪心)
[face recognition series] | realize automatic makeup
Mysql数据库慢sql抓取与分析
Overturn your cognition? The nature of get and post requests
Data processing methods - smote series and adasyn
颠覆你的认知?get和post请求的本质
捷码赋能案例:专业培训、技术支撑,多措并举推动毕业生搭建智慧校园毕设系统
Yyds dry inventory automatic lighting system based on CC2530 (ZigBee)
[try to hack] John hash cracking tool
How many of the 10 most common examples of istio traffic management do you know?
R note prophet
VPP performance test
How does computer nail adjust sound
coreldraw2022新版本新功能介绍cdr2022
深入浅出node模板解析错误escape is not a function
Stable Huawei micro certification, stable Huawei cloud database service practice
tengine 内核参数
After learning classes and objects, I wrote a date class
Complete list of common functions of turtle module