Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
FAST-RNNT
Commits
371e2657
Commit
371e2657
authored
Jul 26, 2021
by
Daniel Povey
Browse files
Start changing some names
parent
9c56e510
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
13 additions
and
32 deletions
+13
-32
LICENSE_code
LICENSE_code
+1
-1
MANIFEST.in
MANIFEST.in
+1
-1
setup.py
setup.py
+11
-30
torch_mutual_information/__init__.py
torch_mutual_information/__init__.py
+0
-0
torch_mutual_information/learned_nonlin.py
torch_mutual_information/learned_nonlin.py
+0
-0
torch_mutual_information/learned_nonlin_cpu.cpp
torch_mutual_information/learned_nonlin_cpu.cpp
+0
-0
torch_mutual_information/learned_nonlin_cuda.cpp
torch_mutual_information/learned_nonlin_cuda.cpp
+0
-0
torch_mutual_information/learned_nonlin_cuda_kernel.cu
torch_mutual_information/learned_nonlin_cuda_kernel.cu
+0
-0
torch_mutual_information/learned_nonlin_test.py
torch_mutual_information/learned_nonlin_test.py
+0
-0
No files found.
LICENSE_code
View file @
371e2657
...
@@ -4,7 +4,7 @@ excluding any dependencies.
...
@@ -4,7 +4,7 @@ excluding any dependencies.
BSD 3-Clause License
BSD 3-Clause License
Copyright (c) 2021,
Anton Obukhov
Copyright (c) 2021,
Xiaomi Corporation (written by: Daniel Povey)
All rights reserved.
All rights reserved.
Redistribution and use in source and binary forms, with or without
Redistribution and use in source and binary forms, with or without
...
...
MANIFEST.in
View file @
371e2657
include requirements.txt
include requirements.txt
include pyproject.toml
include pyproject.toml
include LICENSE*
include LICENSE*
recursive-include torch_
discounted_cumsum
*
recursive-include torch_
mutual_information
*
recursive-include doc/img *
recursive-include doc/img *
recursive-include tests *
recursive-include tests *
global-exclude *.pyc
global-exclude *.pyc
\ No newline at end of file
setup.py
View file @
371e2657
...
@@ -9,48 +9,31 @@ with open('requirements.txt') as f:
...
@@ -9,48 +9,31 @@ with open('requirements.txt') as f:
long_description
=
"""
long_description
=
"""
This package implements an efficient parallel algorithm for the computation of discounted cumulative sums
This package implements an efficient parallel algorithm for the computation of
with differentiable bindings to PyTorch. The `cumsum` operation is frequently seen in data science
mutual information between sequences with differentiable bindings to PyTorch.
domains concerned with time series, including Reinforcement Learning (RL).
The traditional sequential algorithm performs the computation of the output elements in a loop. For an input of size
`N`, it requires `O(N)` operations and takes `O(N)` time steps to complete.
The proposed parallel algorithm requires a total of `O(N log N)` operations, but takes only `O(log N)` time, which is a
considerable trade-off in many applications involving large inputs.
Features of the parallel algorithm:
- Speed logarithmic in the input size
- Better numerical precision than sequential algorithms
Features of the package:
- CPU: sequential algorithm in C++
- GPU: parallel algorithm in CUDA
- Gradients computation wrt input
- Both left and right directions of summation supported
- PyTorch bindings
Find more details and the most up-to-date information on the project webpage:
Find more details and the most up-to-date information on the project webpage:
https://www.github.com/toshas/torch-discounted-cumsum
[TODO]
"""
"""
def
configure_extensions
():
def
configure_extensions
():
out
=
[
out
=
[
CppExtension
(
CppExtension
(
'torch_
learned_nonli
n_cpu'
,
'torch_
mutual_informatio
n_cpu'
,
[
[
os
.
path
.
join
(
'torch_
learned_nonlin'
,
'learned_nonli
n_cpu.cpp'
),
os
.
path
.
join
(
'torch_
mutual_information'
,
'mutual_informatio
n_cpu.cpp'
),
],
],
)
)
]
]
try
:
try
:
out
.
append
(
out
.
append
(
CUDAExtension
(
CUDAExtension
(
'torch_
learned_nonli
n_cuda'
,
'torch_
mutual_informatio
n_cuda'
,
[
[
os
.
path
.
join
(
'torch_
learned_nonlin'
,
'learned_nonli
n_cuda.cpp'
),
os
.
path
.
join
(
'torch_
mutual_information'
,
'mutual_informatio
n_cuda.cpp'
),
os
.
path
.
join
(
'torch_
learned_nonlin'
,
'learned_nonli
n_cuda_kernel.cu'
),
os
.
path
.
join
(
'torch_
mutual_information'
,
'mutual_informatio
n_cuda_kernel.cu'
),
],
],
)
)
)
)
...
@@ -60,9 +43,9 @@ def configure_extensions():
...
@@ -60,9 +43,9 @@ def configure_extensions():
setup
(
setup
(
name
=
'torch_
learned_nonli
n'
,
name
=
'torch_
mutual_informatio
n'
,
version
=
'1.0.2'
,
version
=
'1.0.2'
,
description
=
'
Fast discounted cumulative sums in PyTorch
'
,
description
=
'
Mutual information between sequences of vectors
'
,
long_description
=
long_description
,
long_description
=
long_description
,
long_description_content_type
=
'text/markdown'
,
long_description_content_type
=
'text/markdown'
,
install_requires
=
requirements
,
install_requires
=
requirements
,
...
@@ -70,13 +53,11 @@ setup(
...
@@ -70,13 +53,11 @@ setup(
packages
=
find_packages
(),
packages
=
find_packages
(),
author
=
'Dan Povey'
,
author
=
'Dan Povey'
,
license
=
'BSD'
,
license
=
'BSD'
,
url
=
'https://www.github.com/toshas/torch-discounted-cumsum'
,
ext_modules
=
configure_extensions
(),
ext_modules
=
configure_extensions
(),
cmdclass
=
{
cmdclass
=
{
'build_ext'
:
BuildExtension
'build_ext'
:
BuildExtension
},
},
keywords
=
[
keywords
=
[
'pytorch'
,
'discounted'
,
'cumsum'
,
'cumulative'
,
'sum'
,
'scan'
,
'differentiable'
,
'pytorch'
,
'sequence'
,
'mutual'
,
'information'
'reinforcement'
,
'learning'
,
'rewards'
,
'time'
,
'series'
],
],
)
)
torch_
learned_nonli
n/__init__.py
→
torch_
mutual_informatio
n/__init__.py
View file @
371e2657
File moved
torch_
learned_nonli
n/learned_nonlin.py
→
torch_
mutual_informatio
n/learned_nonlin.py
View file @
371e2657
File moved
torch_
learned_nonli
n/learned_nonlin_cpu.cpp
→
torch_
mutual_informatio
n/learned_nonlin_cpu.cpp
View file @
371e2657
File moved
torch_
learned_nonli
n/learned_nonlin_cuda.cpp
→
torch_
mutual_informatio
n/learned_nonlin_cuda.cpp
View file @
371e2657
File moved
torch_
learned_nonli
n/learned_nonlin_cuda_kernel.cu
→
torch_
mutual_informatio
n/learned_nonlin_cuda_kernel.cu
View file @
371e2657
File moved
torch_
learned_nonli
n/learned_nonlin_test.py
→
torch_
mutual_informatio
n/learned_nonlin_test.py
View file @
371e2657
File moved
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