Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
neural_filters
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
software
neural_filters
Commits
3c1ab084
Commit
3c1ab084
authored
Oct 22, 2018
by
M. François
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tanh deprecated in pytorch
parent
82217ab9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
neural_filters/neural_filter_2CC.py
neural_filters/neural_filter_2CC.py
+4
-4
No files found.
neural_filters/neural_filter_2CC.py
View file @
3c1ab084
...
...
@@ -115,7 +115,7 @@ class NeuralFilter2CC(torch.nn.Module):
def
step
(
self
,
input_var
,
hidden
,
a
=
None
,
b
=
None
):
if
a
is
None
or
b
is
None
:
modulus
=
torch
.
sigmoid
(
self
.
bias_modulus
)
cosangle
=
F
.
tanh
(
self
.
bias_theta
)
cosangle
=
torch
.
tanh
(
self
.
bias_theta
)
a
=
2
*
cosangle
*
modulus
b
=
-
modulus
.
pow
(
2
)
...
...
@@ -141,7 +141,7 @@ class NeuralFilter2CC(torch.nn.Module):
# do not recompute this at each step to gain efficiency
modulus
=
torch
.
sigmoid
(
self
.
bias_modulus
)
cosangle
=
F
.
tanh
(
self
.
bias_theta
)
cosangle
=
torch
.
tanh
(
self
.
bias_theta
)
a
=
2
*
cosangle
*
modulus
b
=
-
modulus
.
pow
(
2
)
...
...
@@ -155,7 +155,7 @@ class NeuralFilter2CC(torch.nn.Module):
def
print_param
(
self
):
modulus
=
torch
.
sigmoid
(
self
.
bias_modulus
)
cosangle
=
F
.
tanh
(
self
.
bias_theta
)
cosangle
=
torch
.
tanh
(
self
.
bias_theta
)
p1
=
-
2
*
cosangle
*
modulus
p2
=
modulus
.
pow
(
2
)
print
(
'{}
\
t
{}'
.
format
(
p1
.
data
[
0
],
p2
.
data
[
0
]))
...
...
@@ -163,7 +163,7 @@ class NeuralFilter2CC(torch.nn.Module):
@
property
def
denominator
(
self
):
modulus
=
torch
.
sigmoid
(
self
.
bias_modulus
)
cosangle
=
F
.
tanh
(
self
.
bias_theta
)
cosangle
=
torch
.
tanh
(
self
.
bias_theta
)
p1
=
-
2
*
cosangle
*
modulus
p2
=
modulus
.
pow
(
2
)
p1
=
p1
.
detach
().
cpu
().
numpy
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment