ikintosh / gabornet Goto Github PK
View Code? Open in Web Editor NEWHome Page: https://ikintosh.github.io/GaborNet/
License: MIT License
Home Page: https://ikintosh.github.io/GaborNet/
License: MIT License
GaborNet/GaborNet/GaborLayer.py
Lines 52 to 60 in a104371
GaborNet/GaborNet/GaborLayer.py
Lines 52 to 60 in a104371
When refactor, the performance (in this case, ability to learn proper image representation) should be tested. So it's necessary to find simple dataset and add test case to train simple CNN on it and monitor accuracy metric.
This should be removed from implementation:
from torch.nn.modules.conv import _ConvNd
from torch.nn.modules.utils import _pair
class GaborConv2d(_ConvNd):
...
Hi guys,
I was wondering if you have any available pretrained weights for the GaborLayer?
Should have proper names:
Hi Andrey, I have a couple of questions about calculate_weights().
Hello,
Thank you @iKintosh for providing your code.
I'm currently trying to use your layer in my code (with torch 1.1.0) and I ran into some minor problems
I think the following lines should be updated in your code but I'm not sure so I decided to just point them out here :
1- Line 19 -> padding_mode
should be added
super(GaborSmallConv2d, self).__init__(in_channels, out_channels, kernel_size, stride, padding, dilation, False, _pair(0), groups, bias, padding_mode='zeros')
2- Line 24 -> .type(torch.Tensor)
should be added to make learnable parameter floating
self.theta = nn.Parameter(0.628*torch.randint(0, 6, (out_channels, in_channels)).type(torch.Tensor))
3- Line 62 -> same as #1
super(GaborConv2d, self).__init__(in_channels, out_channels, kernel_size, stride, padding, dilation, False, _pair(0), groups, bias, padding_mode='zeros')
4- Line 72 -> second parameter for meshgrid should be self.x0-1
not self.x0
(??)
y, x = torch.meshgrid([torch.linspace(-self.x0+1, self.x0, self.kernel_size[0]), torch.linspace(-self.y0+1, self.y0, self.kernel_size[1])])
5- Line 105 -> same as #1
super(GaborCurvedConv2d, self).__init__(in_channels, out_channels, kernel_size, stride, padding, dilation, False, _pair(0), groups, bias, padding_mode='zeros')
sanity_check requires heavy computation (probably with GPU) so it cannot be part of test suite. However it is nice to have sanity_check case to be able to test layer performance.
Hello,
Could you please tell me what is the difference between "GaborSmallConv2d", "GaborConv2d" and "GaborCurvedConv2d"? from the math point of view.
Is there any way to make GaborLayer not to calculate weights every time in evaluate or no_grads mode?
I guess I should change something in forward method, but I have no idea what to do.
Lines 71 to 93 in 435e031
Remove loops
GaborNet/GaborNet/GaborLayer.py
Lines 103 to 119 in a104371
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.