当前位置:网站首页>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边栏推荐
- LVS+KeepAlived高可用部署实战应用
- Gd32f303 firmware library development (10) -- dual ADC polling mode scanning multiple channels
- ssh免密登陆
- 二进制的原码、反码、补码
- Qt+ffmpeg environment construction
- There will be a black line on the border when the button in the wechat applet is clicked
- 96. Different binary search trees (medium binary search tree dynamic planning)
- DOM programming + events
- PaddleNLP基于ERNIR3.0文本分类以中医疗搜索检索词意图分类(KUAKE-QIC)为例【多分类(单标签)】
- Kali source solution software cannot be installed correctly
猜你喜欢
![Memseg [anomaly detection: embedded based]](/img/10/aea2b6ecf55e04fe24f78e5fb897be.png)
Memseg [anomaly detection: embedded based]

Att & CK Threat Intelligence
Integrating database Ecology: using eventbridge to build CDC applications

STM32_ Hal library driven framework
![Ocr-gan [anomaly detection: Reconstruction Based]](/img/16/62d962288c192b3df2fdb518d7127e.gif)
Ocr-gan [anomaly detection: Reconstruction Based]
![CFA [anomaly detection: embedded_based]](/img/ee/da822a7e8b443236338d4274b066c7.png)
CFA [anomaly detection: embedded_based]

Stm32+ four pin OLED screen + Chinese character mold taking

Gd32f303 firmware library development (10) -- dual ADC polling mode scanning multiple channels

es个人整理的相关面试题

What to do after mathematical modeling gets the competition problem and some ("crooked ways") tips - must see before the competition
随机推荐
Gd32f303 firmware library development (10) -- dual ADC polling mode scanning multiple channels
Configuration and official document of Freia library [tips]
STM32 - DMA direct memory access controller (cubemx configures DMA)
删除容器镜像报错解决image is referenced in multiple repositories
STM32 board level support package for keys
基于Ernie-3.0 CAIL2019法研杯要素识别多标签分类任务
PaddleNLP基于ERNIR3.0文本分类:WOS数据集为例(层次分类)
近期bug总结
imx6q gpio复用
STM32 - external interrupt application (exti) (use cubemx to configure interrupts)
775. 倒排单词
XXX port is already in use
771. 字符串中最长的连续出现的字符
Awk blank line filtering
776. 字符串移位包含问题
776. String shift inclusion problem
Leetcode question brushing series - sum of majority type
Lvs+keepalived high availability deployment practical application
Closure, prototype and original link
PaddleNLP基于ERNIR3.0文本分类以CAIL2018-SMALL数据集罪名预测任务为例【多标签】