- Link to Paper
- Spatial pooling layers are building blocks for Convolutional Neural Networks (CNNs).
- Input to pooling operation is a Nin x Nin matrix and output is a smaller matrix Nout x Nout.
- Pooling operation divides Nin x Nin square into N2out pooling regions Pi, j.
- Pi, j ⊂ {1, 2, . . . , Nin} ∀ (i, j) ∈ {1, . . . , Nout}2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
KITTI stereo disparity 3 pixel error, corrected | |
REFERENCES: | |
* [PMSNet code](https://github.com/JiaRenChang/PSMNet/blob/b6520ff9b77168e3dfe3485f8bf6a2a798361d85/finetune.py) | |
* [type converter](https://github.com/traveller59/torchplus/blob/master/tools.py) | |
MATLAB code: | |
``` | |
% disp_error.m |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def extract_patches_2d(img,patch_shape,step=[1.0,1.0],batch_first=False): | |
patch_H, patch_W = patch_shape[0], patch_shape[1] | |
if(img.size(2)<patch_H): | |
num_padded_H_Top = (patch_H - img.size(2))//2 | |
num_padded_H_Bottom = patch_H - img.size(2) - num_padded_H_Top | |
padding_H = nn.ConstantPad2d((0,0,num_padded_H_Top,num_padded_H_Bottom),0) | |
img = padding_H(img) | |
if(img.size(3)<patch_W): | |
num_padded_W_Left = (patch_W - img.size(3))//2 | |
num_padded_W_Right = patch_W - img.size(3) - num_padded_W_Left |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
from torch import nn | |
__all__ = ['FCDenseNet', 'fcdensenet_tiny', 'fcdensenet56_nodrop', | |
'fcdensenet56', 'fcdensenet67', 'fcdensenet103', | |
'fcdensenet103_nodrop'] | |
class DenseBlock(nn.Module): |