Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
macaon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Franck Dary
macaon
Commits
3b8126b8
Commit
3b8126b8
authored
5 years ago
by
Franck Dary
Browse files
Options
Downloads
Patches
Plain Diff
Renamed RTLSTMNetwork to RLTNetwork to match name used by Elkaref paper
parent
29883154
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
reading_machine/src/Classifier.cpp
+4
-4
4 additions, 4 deletions
reading_machine/src/Classifier.cpp
torch_modules/include/RLTNetwork.hpp
+4
-4
4 additions, 4 deletions
torch_modules/include/RLTNetwork.hpp
torch_modules/src/RLTNetwork.cpp
+4
-4
4 additions, 4 deletions
torch_modules/src/RLTNetwork.cpp
with
12 additions
and
12 deletions
reading_machine/src/Classifier.cpp
+
4
−
4
View file @
3b8126b8
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
#include
"util.hpp"
#include
"util.hpp"
#include
"OneWordNetwork.hpp"
#include
"OneWordNetwork.hpp"
#include
"ConcatWordsNetwork.hpp"
#include
"ConcatWordsNetwork.hpp"
#include
"RT
LSTM
Network.hpp"
#include
"R
L
TNetwork.hpp"
#include
"CNNNetwork.hpp"
#include
"CNNNetwork.hpp"
Classifier
::
Classifier
(
const
std
::
string
&
name
,
const
std
::
string
&
topology
,
const
std
::
string
&
tsFile
)
Classifier
::
Classifier
(
const
std
::
string
&
name
,
const
std
::
string
&
topology
,
const
std
::
string
&
tsFile
)
...
@@ -56,11 +56,11 @@ void Classifier::initNeuralNetwork(const std::string & topology)
...
@@ -56,11 +56,11 @@ void Classifier::initNeuralNetwork(const std::string & topology)
}
}
},
},
{
{
std
::
regex
(
"RT
LSTM
\\
(([+
\\
-]?
\\
d+),([+
\\
-]?
\\
d+),([+
\\
-]?
\\
d+)
\\
)"
),
std
::
regex
(
"R
L
T
\\
(([+
\\
-]?
\\
d+),([+
\\
-]?
\\
d+),([+
\\
-]?
\\
d+)
\\
)"
),
"RT
LSTM
(leftBorder,rightBorder,nbStack) : Recursive tree LSTM."
,
"R
L
T(leftBorder,rightBorder,nbStack) : Recursive tree LSTM."
,
[
this
,
topology
](
auto
sm
)
[
this
,
topology
](
auto
sm
)
{
{
this
->
nn
.
reset
(
new
RT
LSTM
NetworkImpl
(
this
->
transitionSet
->
size
(),
std
::
stoi
(
sm
[
1
]),
std
::
stoi
(
sm
[
2
]),
std
::
stoi
(
sm
[
3
])));
this
->
nn
.
reset
(
new
R
L
TNetworkImpl
(
this
->
transitionSet
->
size
(),
std
::
stoi
(
sm
[
1
]),
std
::
stoi
(
sm
[
2
]),
std
::
stoi
(
sm
[
3
])));
}
}
},
},
};
};
...
...
This diff is collapsed.
Click to expand it.
torch_modules/include/RT
LSTM
Network.hpp
→
torch_modules/include/R
L
TNetwork.hpp
+
4
−
4
View file @
3b8126b8
#ifndef RT
LSTM
NETWORK__H
#ifndef R
L
TNETWORK__H
#define RT
LSTM
NETWORK__H
#define R
L
TNETWORK__H
#include
"NeuralNetwork.hpp"
#include
"NeuralNetwork.hpp"
class
RT
LSTM
NetworkImpl
:
public
NeuralNetworkImpl
class
R
L
TNetworkImpl
:
public
NeuralNetworkImpl
{
{
private
:
private
:
...
@@ -21,7 +21,7 @@ class RTLSTMNetworkImpl : public NeuralNetworkImpl
...
@@ -21,7 +21,7 @@ class RTLSTMNetworkImpl : public NeuralNetworkImpl
public
:
public
:
RT
LSTM
NetworkImpl
(
int
nbOutputs
,
int
leftBorder
,
int
rightBorder
,
int
nbStackElements
);
R
L
TNetworkImpl
(
int
nbOutputs
,
int
leftBorder
,
int
rightBorder
,
int
nbStackElements
);
torch
::
Tensor
forward
(
torch
::
Tensor
input
)
override
;
torch
::
Tensor
forward
(
torch
::
Tensor
input
)
override
;
std
::
vector
<
long
>
extractContext
(
Config
&
config
,
Dict
&
dict
)
const
override
;
std
::
vector
<
long
>
extractContext
(
Config
&
config
,
Dict
&
dict
)
const
override
;
};
};
...
...
This diff is collapsed.
Click to expand it.
torch_modules/src/RT
LSTM
Network.cpp
→
torch_modules/src/R
L
TNetwork.cpp
+
4
−
4
View file @
3b8126b8
#include
"RT
LSTM
Network.hpp"
#include
"R
L
TNetwork.hpp"
RT
LSTM
NetworkImpl
::
RT
LSTM
NetworkImpl
(
int
nbOutputs
,
int
leftBorder
,
int
rightBorder
,
int
nbStackElements
)
R
L
TNetworkImpl
::
R
L
TNetworkImpl
(
int
nbOutputs
,
int
leftBorder
,
int
rightBorder
,
int
nbStackElements
)
{
{
constexpr
int
embeddingsSize
=
30
;
constexpr
int
embeddingsSize
=
30
;
constexpr
int
lstmOutputSize
=
128
;
constexpr
int
lstmOutputSize
=
128
;
...
@@ -21,7 +21,7 @@ RTLSTMNetworkImpl::RTLSTMNetworkImpl(int nbOutputs, int leftBorder, int rightBor
...
@@ -21,7 +21,7 @@ RTLSTMNetworkImpl::RTLSTMNetworkImpl(int nbOutputs, int leftBorder, int rightBor
nullTree
=
register_parameter
(
"null_tree"
,
torch
::
randn
(
treeEmbeddingsSize
));
nullTree
=
register_parameter
(
"null_tree"
,
torch
::
randn
(
treeEmbeddingsSize
));
}
}
torch
::
Tensor
RT
LSTM
NetworkImpl
::
forward
(
torch
::
Tensor
input
)
torch
::
Tensor
R
L
TNetworkImpl
::
forward
(
torch
::
Tensor
input
)
{
{
if
(
input
.
dim
()
==
1
)
if
(
input
.
dim
()
==
1
)
input
=
input
.
unsqueeze
(
0
);
input
=
input
.
unsqueeze
(
0
);
...
@@ -79,7 +79,7 @@ torch::Tensor RTLSTMNetworkImpl::forward(torch::Tensor input)
...
@@ -79,7 +79,7 @@ torch::Tensor RTLSTMNetworkImpl::forward(torch::Tensor input)
return
linear2
(
torch
::
relu
(
linear1
(
representation
)));
return
linear2
(
torch
::
relu
(
linear1
(
representation
)));
}
}
std
::
vector
<
long
>
RT
LSTM
NetworkImpl
::
extractContext
(
Config
&
config
,
Dict
&
dict
)
const
std
::
vector
<
long
>
R
L
TNetworkImpl
::
extractContext
(
Config
&
config
,
Dict
&
dict
)
const
{
{
std
::
vector
<
long
>
contextIndexes
;
std
::
vector
<
long
>
contextIndexes
;
std
::
stack
<
int
>
leftContext
;
std
::
stack
<
int
>
leftContext
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment