当前位置:网站首页>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边栏推荐
- PaddleNLP基于ERNIR3.0文本分类:WOS数据集为例(层次分类)
- NPM switch Taobao source (NPM source)
- ngx+sql环境离线安装日志(rpm安装)
- 79. Word search (medium string array matrix backtracking)
- XXX port is already in use
- Ocr-gan [anomaly detection: Reconstruction Based]
- Padim [anomaly detection: embedded based]
- Summary of recent bugs
- How do we do full link grayscale on the database?
- STM32 - advanced control timer (time base unit, functional block diagram, input, capture, output, open circuit)
猜你喜欢

使用PCL批量显示PCD点云数据流

79. Word search (medium string array matrix backtracking)

Install PCL and VTK under the background of ROS installation, and solve VTK and PCL_ ROS conflict problem
![Memseg [anomaly detection: embedded based]](/img/10/aea2b6ecf55e04fe24f78e5fb897be.png)
Memseg [anomaly detection: embedded based]

LVS+KeepAlived高可用部署实战应用

842. Arrange numbers

Quadruped robot | gem (elevation map) + fast_ Deployment records of Leo (odometry) environment
![Differernet [anomaly detection: normalizing flow]](/img/75/958d753c20227fbbfe1085e7d6ce6f.png)
Differernet [anomaly detection: normalizing flow]

Use PCL to batch convert point cloud.Bin files to.Pcd

JVM -- custom class loader
随机推荐
《结构学》介绍
PaddleNLP基于ERNIR3.0文本分类以中医疗搜索检索词意图分类(KUAKE-QIC)为例【多分类(单标签)】
770. Word replacement
JVM -- custom class loader
Ultra detailed visual studio 2019 running littlevgl (lvgl) simulator
二进制的原码、反码、补码
STM32 - Communication
Redis related
Closure, prototype and original link
Evaluation index of anomaly detection: rocauc et al. [tips]
Concise history of graphic technology
Paddlenlp text classification based on ernir3.0: take wos dataset as an example (hierarchical classification)
775. Inverted words
STM32 - interrupt overview (interrupt priority)
Soft exam network engineer
STM32 - Basic timer (tim6, tim7) working process, interpretation function block diagram, timing analysis, cycle calculation
105. Construct binary tree from preorder and inorder traversal sequence (medium binary tree DFS hash table binary tree)
79. Word search (medium string array matrix backtracking)
Att & CK preliminary understanding
STM32 -- program startup process