当前位置:网站首页>OSV_ Q write divergence operator div and Laplace stepped on the pit
OSV_ Q write divergence operator div and Laplace stepped on the pit
2022-07-28 22:44:00 【Claire_ Shang】
In order to write the image matrix of Laplace , You need to use the divergence operator
Start copying other people's code
def divergence(x, y):
divx = x - np.roll(x, 1, axis=1)
divy = y - np.roll(y, 1, axis=-1)
div = divx + divy
return div
Report errors : Because it's not supported Tensor and list Division operation of type # loss1 = miu2 * mse(u1, f1 - dive + b2) # Because it's not supported Tensor and list Division operation of type # loss1 = torch.optim.Adam(f1 - dive + b2, lr=0.1) # l2 Regularization
Report errors : Because it's not supported Tensor and Add Division operation of type
Write Laplace in the most primitive way
zxx, zxy = getGrd(zx) zyx, zyy = getGrd(zy) dive = zxx + zyy
.......
Although there are other new mistakes , To move forward
Report errors :
dive1 = zxx + zyy
RuntimeError: The size of tensor a (320) must match the size of tensor b (318) at non-singleton dimension 3
Maybe I did two gradients , Dimensions are inconsistent , Choose to zero the boundary of the gradient :
def getGrd(data_in):
# [m, n] = data_in.shape
# data_in1 = torch.Tensor(np.pad(data_in, ((0, 0), (0, 0), (0, 0), (0, 0)), 'edge'))
grd_x = data_in.clone()
grd_y = data_in.clone()
grd_x = grd_x[:, :, 0:-1, :] - data_in[:, :, 1:, :]
# grd_x = torch.Tensor(np.pad(grd_x, ((0, 0), (0, 0), (0, 1), (0, 0)), "constant")) # Zero compensation
grd_y = grd_y[:, :, :, 0:-1] - data_in[:, :, :, 1:]
# grd_y = torch.Tensor(np.pad(grd_y, ((0, 0), (0, 0), (0, 0), (0, 1)), "constant"))
# Zero compensation
grd = (grd_x, grd_y)
return grd边栏推荐
- Summary of common error types in JS
- Solve various problems of sudo rosdep init and rosdep update
- MySQL command (add, delete, check and modify)
- 删除容器镜像报错解决image is referenced in multiple repositories
- 842. Arrange numbers
- Why doesn't the icon on the elment plus icon input display
- JS implementation generates a random key of specified length
- 基于Ernie-3.0 CAIL2019法研杯要素识别多标签分类任务
- Research cup element recognition multi label classification task based on ernie-3.0 cail2019 method
- [connect your mobile phone wirelessly] - debug your mobile device wirelessly via LAN
猜你喜欢

Lvs+keepalived high availability deployment practical application

XXX port is already in use

微信小程序剪切图片的功能

Stm32+ four pin OLED screen + Chinese character mold taking

Anomaly detection summary: intensity_ based/Normalizing Flow

Qt+FFmpeg环境搭建

STM32 - systick timer (cubemx configures systick)

Using PCL to batch display PCD point cloud data flow

Ngrok intranet penetration

es个人整理的相关面试题
随机推荐
Bluetooth smart Bracelet system based on STM32 MCU
SSH password free login
Common commands of NPM
STM32 board level support package for keys
Evaluation index of anomaly detection: rocauc et al. [tips]
When can I sign up for the 2022 class I constructor examination?
JS获取当前时间(年月日时分秒)
Att & CK Threat Intelligence
容器化配置启动redis集群 单机6节点 3主3从
Leetcode question brushing series - sum of majority type
2022年一级建造师考试什么时候才能报名?
[reprint] the token token is used in the login scenario
UNET [basic network]
770. Word replacement
Install PCL and VTK under the background of ROS installation, and solve VTK and PCL_ ROS conflict problem
Kali source solution software cannot be installed correctly
Memseg [anomaly detection: embedded based]
[connect your mobile phone wirelessly] - debug your mobile device wirelessly via LAN
flask之蓝图 补充openpyxl
Integrating database Ecology: using eventbridge to build CDC applications