当前位置:网站首页>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
边栏推荐
- Brief tutorial for soft exam system architecture designer | general catalog
- Stable Huawei micro certification, stable Huawei cloud database service practice
- Unity screen coordinates ugui coordinates world coordinates conversion between three coordinate systems
- MySQL reported an error datetime (0) null
- Redis —— Redis In Action —— Redis 实战—— 实战篇一 —— 基于 Redis 的短信登录功能 —— Redis + Token 的共享 session 应用— 有代码
- 10 exemples les plus courants de gestion du trafic istio, que savez - vous?
- PTA tiantisai l1-078 teacher Ji's return (15 points) detailed explanation
- Lagrange polynomial
- 解决“C2001:常量中有换行符“编译问题
- I'd like to ask about the current MySQL CDC design. In the full volume phase, if a chunk's binlog backfill phase,
猜你喜欢
MLAPI系列 - 04 - 网络变量和网络序列化【网络同步】
Visio draw fan
Mysql数据库慢sql抓取与分析
Basic use of MySQL (it is recommended to read and recite the content)
Mysql database storage engine
How does computer nail adjust sound
[network] channel attention network and spatial attention network
Ue5 small knowledge points to enable the setting of lumen
11. Intranet penetration and automatic refresh
During pycharm debugging, the view is read only and pause the process to use the command line appear on the console input
随机推荐
Script lifecycle
canal同步mysql数据变化到kafka(centos部署)
Database - MySQL storage engine (deadlock)
How do programmers teach their bosses to do things in one sentence? "I'm off duty first. You have to work harder."
动态规划(树形dp)
How to realize automatic playback of H5 video
Yyds dry goods inventory OSI & tcp/ip
1291_ Add timestamp function in xshell log
729. 我的日程安排表 I(set or 动态开点线段树)
About some basic DP -- those things about coins (the basic introduction of DP)
flink sql 能同时读多个topic吗。with里怎么写
Use sentinel to interface locally
P2022 interesting numbers (binary & digit DP)
Redis —— Redis In Action —— Redis 实战—— 实战篇一 —— 基于 Redis 的短信登录功能 —— Redis + Token 的共享 session 应用— 有代码
P2102 地砖铺设(dfs&贪心)
SharedPreferences source code analysis
ue5 小知识点 开启lumen的设置
Easyrecovery reliable and toll free data recovery computer software
[Yu Yue education] reference materials of complex variable function and integral transformation of Northwestern Polytechnic University
R note prophet