ivanfei / co-occurrence-layer.pytorch Goto Github PK
View Code? Open in Web Editor NEWThis Repo is pytorch implementation for "Co-Occurrence Neural Network - CVPR 2019"
Home Page: https://github.com/IvanFei/Co-Occurrence-Layer.pytorch
This Repo is pytorch implementation for "Co-Occurrence Neural Network - CVPR 2019"
Home Page: https://github.com/IvanFei/Co-Occurrence-Layer.pytorch
### Verify validityοΌ
It is important to test the effectiveness of the Co-Occurrence Neural Network.
Compared with FC and Conv.
Check the results of FC, Conv and Conn in Toy Example Data.
In function_quantization_input_as_bins
from src/co_layer.py
:
When there's negative value in input
, there are chances that min-max normalization misfunction.
Say if tensor A.max()=2
, A.min()=-1
, then max-min ing element 2
is (2-(-1))/2
, which result to a value greater than 1, then this 1 soon is multiplied by num_quantization
and then floor
to index num_quantizetion
, which is out of range of shape.
The author of the paper wants the filter to work on real-world image, in which there're no neg values. But what if we use it in neg-possible input?
In the paper, author said:
Because the input activation values can take any real
value, we quantize them uniformly into k bins. Specifically, we normalize the values of every channel to be in the range [0,1] and then for each x β [0,1], we define the index of x as [x] = round(kx)
Does this problem also exist in the original implementation in tensorflow given by author?
### position:
when train with Conn.
line 39 in co_layer.py: using the index_select function
line 49 in co_layer.py: input_mask = torch.conv3d(input_mask, self.filters_ones, stride=[self.stride, self.stride, self.stride])
### error:
RuntimeError: cuDNN error: CUDNN_STATUS_ALLOC_FAILED
RuntimeError: cuDNN error: CUDNN_STATUS_NOT_INITIALIZED
### device:
hpc3 -> GTX 1080Ti
### Need Optimize:
The code below has some problem.
input_idx = input_norm * (num_quantization - 1)
input_idx = torch.round(input_idx).int()
### For example:
when input_norm is in range of 0-1.
and num_quantization is 4.
the first line of code make input_idx to 0-3
and the second line of code make input_idx to 0, 1, 2, 3
bug the range of 0-0.5 become 0,
and the range 0.5-1.5 become 1,
and 1.5-2.5 to 2,
2.5 - 3 to 3.
which is not uniform.
So it need to optimize.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.