Skip to main content

Meet Gabor Layer

Project description

GaborNet

PyPI-Status Build Status LICENSE DeepSource

Installation

GaborNet can be installed via pip from Python 3.7 and above:

pip install GaborNet

Getting started

import torch
import torch.nn as nn
from torch.nn import functional as F
from GaborNet import GaborConv2d

device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")


class GaborNN(nn.Module):
    def __init__(self):
        super(GaborNN, self).__init__()
        self.g0 = GaborConv2d(in_channels=1, out_channels=96, kernel_size=(11, 11))
        self.c1 = nn.Conv2d(96, 384, (3,3))
        self.fc1 = nn.Linear(384*3*3, 64)
        self.fc2 = nn.Linear(64, 2)

    def forward(self, x):
        x = F.leaky_relu(self.g0(x))
        x = nn.MaxPool2d()(x)
        x = F.leaky_relu(self.c1(x))
        x = nn.MaxPool2d()(x)
        x = x.view(-1, 384*3*3)
        x = F.leaky_relu(self.fc1(x))
        x = self.fc2(x)
        return x

net = GaborNN().to(device)

Original research paper (preprint): https://arxiv.org/abs/1904.13204

This research on deep convolutional neural networks proposes a modified architecture that focuses on improving convergence and reducing training complexity. The filters in the first layer of network are constrained to fit the Gabor function. The parameters of Gabor functions are learnable and updated by standard backpropagation techniques. The proposed architecture was tested on several datasets and outperformed the common convolutional networks

Citation

Please use this bibtex if you want to cite this repository in your publications:

@misc{gabornet,
    author = {Alekseev, Andrey},
    title = {GaborNet: Gabor filters with learnable parameters in deep convolutional
               neural networks},
    year = {2019},
    publisher = {GitHub},
    journal = {GitHub repository},
    howpublished = {\url{https://github.com/iKintosh/GaborNet}},
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

GaborNet-0.2.0.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

GaborNet-0.2.0-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file GaborNet-0.2.0.tar.gz.

File metadata

  • Download URL: GaborNet-0.2.0.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.10 CPython/3.8.5 Linux/5.4.0-42-generic

File hashes

Hashes for GaborNet-0.2.0.tar.gz
Algorithm Hash digest
SHA256 dff93d634433bbc72abe347caa954062795881b64a8105cf4264d3a88ba10b25
MD5 04a71b562cc36cc844401f00ec6e52d9
BLAKE2b-256 0a1f302f6ccee14e0b0770c44d447e6e0ba1c402528cfce8d8c8a63f170ec7e1

See more details on using hashes here.

File details

Details for the file GaborNet-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: GaborNet-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.10 CPython/3.8.5 Linux/5.4.0-42-generic

File hashes

Hashes for GaborNet-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 aa55f4c5459c51e4bbd52837c10895b5cbe52898820bf3aed77b1aee2d35dacb
MD5 ec688dad300db7ba954b4bc90ce87098
BLAKE2b-256 08f0f7d4e44ab2b55d3d9bcfa883fa57ea9991bb25619bad73ba4489b21ea8c4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page