Skip to content
Snippets Groups Projects
Commit 37bd3c00 authored by M. François's avatar M. François
Browse files

Public release

parent 9a284496
No related branches found
No related tags found
No related merge requests found
neural_filters is a PyTorch toolbox implementing linear IIR filters as recurrent neural units
This package implements Neural Filters related to the following paper:
"François Marelli, Bastian Schnell, Hervé Bourlard, Thierry Dutoit, and Philip N. Garner. An end-to-end network to synthesize intonation using a generalized command response model. In Proceedings of the IEEE International Conference on Acoustics, Speech and Signal Processing, Brighton, UK, May 2019"
Neural Filters are linear IIR filters integrated in the PyTorch framework, which can be interfaced with neural networks and trained by gradient descent.
(c) Idiap Research Institute, Francois Marelli <francois.marelli@idiap.ch>
......@@ -8,24 +8,12 @@ NeuralFilterCell
This module implements a basic trainable all-pole first order filter
using pyTorch
Copyright (c) 2018 Idiap Research Institute, http://www.idiap.ch/
Copyright (c) 2019 Idiap Research Institute, http://www.idiap.ch/
Written by Francois Marelli <Francois.Marelli@idiap.ch>
This file is part of neural_filters.
neural_filters is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 3 as
published by the Free Software Foundation.
neural_filters is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with neural_filters. If not, see <http://www.gnu.org/licenses/>.
class neural_filters.neural_filter.NeuralFilter(hidden_size)
A trainable first-order all-pole filter \frac{1}{1 - P z^{-1}}
......@@ -51,24 +39,12 @@ NeuralFilter2R
This module implements a trainable all-pole second order filter with
real poles using pyTorch
Copyright (c) 2018 Idiap Research Institute, http://www.idiap.ch/
Copyright (c) 2019 Idiap Research Institute, http://www.idiap.ch/
Written by Francois Marelli <Francois.Marelli@idiap.ch>
This file is part of neural_filters.
neural_filters is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 3 as
published by the Free Software Foundation.
neural_filters is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with neural_filters. If not, see <http://www.gnu.org/licenses/>.
class neural_filters.neural_filter_2R.NeuralFilter2R(hidden_size)
A trainable second-order all-(real)pole filter \frac{1}{1 - P_{1}
......@@ -95,24 +71,12 @@ NeuralFilter2CD
This module implements a trainable critically damped all-pole second
order filter with real poles using pyTorch
Copyright (c) 2018 Idiap Research Institute, http://www.idiap.ch/
Copyright (c) 2019 Idiap Research Institute, http://www.idiap.ch/
Written by Francois Marelli <Francois.Marelli@idiap.ch>
This file is part of neural_filters.
neural_filters is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 3 as
published by the Free Software Foundation.
neural_filters is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with neural_filters. If not, see <http://www.gnu.org/licenses/>.
class neural_filters.neural_filter_2CD.NeuralFilter2CD(hidden_size)
A trainable second-order critically damped all-pole filter
......@@ -139,24 +103,12 @@ NeuralFilter2CC
This module implements a trainable all-pole second order filter with
complex conjugate poles using pyTorch
Copyright (c) 2018 Idiap Research Institute, http://www.idiap.ch/
Copyright (c) 2019 Idiap Research Institute, http://www.idiap.ch/
Written by Francois Marelli <Francois.Marelli@idiap.ch>
This file is part of neural_filters.
neural_filters is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 3 as
published by the Free Software Foundation.
neural_filters is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with neural_filters. If not, see <http://www.gnu.org/licenses/>.
class neural_filters.neural_filter_2CC.NeuralFilter2CC(hidden_size)
A trainable second-order all-pole filter \frac{1}{1 - 2 P
......
......@@ -14,6 +14,9 @@ ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
all:
make doc
.PHONY: help
help:
@echo "Please use \`make <target>' where <target> is one of"
......
......@@ -53,7 +53,7 @@ master_doc = 'index'
# General information about the project.
project = u'Neural Filters'
copyright = u'2018, Idiap Research Institute'
copyright = u'2019, Idiap Research Institute'
author = u'Francois Marelli'
# The version info for the project you're documenting, acts as replacement for
......
import numpy
"""
neural_filters
**************
Copyright (c) 2018 Idiap Research Institute, http://www.idiap.ch/
Written by Francois Marelli <Francois.Marelli@idiap.ch>
This file is part of neural_filters.
"""
import numpy as np
EPSILON = 1e-6
INIT_MODULUS = 0.95
MIN_ANGLE = 0
MAX_ANGLE = numpy.pi / 2
MAX_ANGLE = np.pi / 2
def asig(x):
......@@ -13,7 +25,7 @@ def asig(x):
x[x == 1] = 1 - EPSILON
x[x == 0] = EPSILON
return -numpy.log((1 / x) - 1)
return -np.log((1 / x) - 1)
def atanh(x):
......@@ -22,7 +34,7 @@ def atanh(x):
x[abs(x) == 1] *= (1 - EPSILON)
return numpy.arctanh(x)
return np.arctanh(x)
from .neural_filter import *
......
......@@ -5,24 +5,12 @@ NeuralFilterCell
This module implements a basic trainable all-pole first order filter using pyTorch
Copyright (c) 2018 Idiap Research Institute, http://www.idiap.ch/
Copyright (c) 2019 Idiap Research Institute, http://www.idiap.ch/
Written by Francois Marelli <Francois.Marelli@idiap.ch>
This file is part of neural_filters.
neural_filters is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 3 as
published by the Free Software Foundation.
neural_filters is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with neural_filters. If not, see <http://www.gnu.org/licenses/>.
"""
import numpy as np
......
......@@ -5,30 +5,19 @@ NeuralFilter2CC
This module implements a trainable all-pole second order filter with complex conjugate poles using pyTorch
Copyright (c) 2018 Idiap Research Institute, http://www.idiap.ch/
Copyright (c) 2019 Idiap Research Institute, http://www.idiap.ch/
Written by Francois Marelli <Francois.Marelli@idiap.ch>
This file is part of neural_filters.
neural_filters is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 3 as
published by the Free Software Foundation.
neural_filters is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with neural_filters. If not, see <http://www.gnu.org/licenses/>.
"""
import numpy as np
import torch
from torch.nn import Parameter
from torch.nn._functions.rnn import Recurrent, VariableRecurrent
from torch.nn import LSTMCell
from torch.nn.utils.rnn import PackedSequence
from . import MIN_ANGLE, MAX_ANGLE, INIT_MODULUS, asig, atanh
......
......@@ -5,24 +5,12 @@ NeuralFilter2CD
This module implements a trainable critically damped all-pole second order filter with real poles using pyTorch
Copyright (c) 2018 Idiap Research Institute, http://www.idiap.ch/
Copyright (c) 2019 Idiap Research Institute, http://www.idiap.ch/
Written by Francois Marelli <Francois.Marelli@idiap.ch>
This file is part of neural_filters.
neural_filters is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 3 as
published by the Free Software Foundation.
neural_filters is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with neural_filters. If not, see <http://www.gnu.org/licenses/>.
"""
import numpy as np
......
......@@ -5,24 +5,12 @@ NeuralFilter2R
This module implements a trainable all-pole second order filter with real poles using pyTorch
Copyright (c) 2018 Idiap Research Institute, http://www.idiap.ch/
Copyright (c) 2019 Idiap Research Institute, http://www.idiap.ch/
Written by Francois Marelli <Francois.Marelli@idiap.ch>
This file is part of neural_filters.
neural_filters is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 3 as
published by the Free Software Foundation.
neural_filters is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with neural_filters. If not, see <http://www.gnu.org/licenses/>.
"""
import numpy as np
......
from setuptools import setup, find_packages
from setuptools import setup
setup(
name='neural-filters',
version='1.2.1',
version='0.1',
description='Linear filters for neural networks in pyTorch',
author='François Marelli (Idiap research institute)',
author_email='francois.marelli@idiap.ch',
......@@ -10,12 +10,13 @@ setup(
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: GNU GPL v3',
'License :: OSI Approved :: MIT',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
],
packages=['neural_filters'],
install_requires=[
'torch>=0.4.0',
'torch>=0.4.0,<1.0',
'numpy',
],
zip_safe=True,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment