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
b882e02b
Commit
b882e02b
authored
4 years ago
by
Franck Dary
Browse files
Options
Downloads
Patches
Plain Diff
Fixed unused parameter warnings
parent
cf619b31
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
reading_machine/src/Action.cpp
+14
-23
14 additions, 23 deletions
reading_machine/src/Action.cpp
torch_modules/src/CNN.cpp
+1
-1
1 addition, 1 deletion
torch_modules/src/CNN.cpp
with
15 additions
and
24 deletions
reading_machine/src/Action.cpp
+
14
−
23
View file @
b882e02b
...
...
@@ -369,7 +369,7 @@ Action Action::addHypothesisRelativeRelaxed(const std::string & colName, Config:
return
addHypothesis
(
colName
,
lineIndex
,
""
).
undo
(
config
,
a
);
};
auto
appliable
=
[
colName
,
object
,
relativeIndex
](
const
Config
&
config
,
const
Action
&
a
)
auto
appliable
=
[](
const
Config
&
,
const
Action
&
)
{
return
true
;
};
...
...
@@ -487,7 +487,7 @@ Action Action::emptyStack()
}
};
auto
appliable
=
[](
const
Config
&
config
,
const
Action
&
)
auto
appliable
=
[](
const
Config
&
,
const
Action
&
)
{
return
true
;
};
...
...
@@ -497,12 +497,12 @@ Action Action::emptyStack()
Action
Action
::
ignoreCurrentCharacter
()
{
auto
apply
=
[](
Config
&
config
,
Action
&
a
)
auto
apply
=
[](
Config
&
config
,
Action
&
)
{
config
.
moveCharacterIndex
(
1
);
};
auto
undo
=
[](
Config
&
config
,
Action
&
a
)
auto
undo
=
[](
Config
&
config
,
Action
&
)
{
config
.
moveCharacterIndex
(
-
1
);
};
...
...
@@ -575,7 +575,7 @@ Action Action::assertIsNotEmpty(const std::string & colName, Config::Object obje
Action
Action
::
addCharsToCol
(
const
std
::
string
&
col
,
int
n
,
Config
::
Object
object
,
int
relativeIndex
)
{
auto
apply
=
[
col
,
n
,
object
,
relativeIndex
](
Config
&
config
,
Action
&
a
)
auto
apply
=
[
col
,
n
,
object
,
relativeIndex
](
Config
&
config
,
Action
&
)
{
auto
index
=
config
.
getRelativeWordIndex
(
object
,
relativeIndex
);
auto
&
curWord
=
config
.
getLastNotEmptyHyp
(
col
,
index
);
...
...
@@ -591,7 +591,7 @@ Action Action::addCharsToCol(const std::string & col, int n, Config::Object obje
curWord
=
fmt
::
format
(
"{}{}"
,
curWord
,
config
.
getLetter
(
config
.
getCharacterIndex
()
+
i
));
};
auto
undo
=
[
col
,
n
,
object
,
relativeIndex
](
Config
&
config
,
Action
&
a
)
auto
undo
=
[
col
,
n
,
object
,
relativeIndex
](
Config
&
config
,
Action
&
)
{
auto
index
=
config
.
getRelativeWordIndex
(
object
,
relativeIndex
);
auto
&
curWord
=
config
.
getLastNotEmptyHyp
(
col
,
index
);
...
...
@@ -703,7 +703,7 @@ Action Action::setRoot(int bufferIndex)
Action
Action
::
updateIds
(
int
bufferIndex
)
{
auto
apply
=
[
bufferIndex
](
Config
&
config
,
Action
&
a
)
auto
apply
=
[
bufferIndex
](
Config
&
config
,
Action
&
)
{
int
lineIndex
=
config
.
getRelativeWordIndex
(
Config
::
Object
::
Buffer
,
bufferIndex
);
int
firstIndexOfSentence
=
-
1
;
...
...
@@ -762,7 +762,7 @@ Action Action::updateIds(int bufferIndex)
}
};
auto
undo
=
[](
Config
&
config
,
Action
&
a
)
auto
undo
=
[](
Config
&
,
Action
&
)
{
// TODO : undo this
};
...
...
@@ -796,7 +796,7 @@ Action Action::attach(Config::Object governorObject, int governorIndex, Config::
a
.
data
.
pop_back
();
};
auto
appliable
=
[
governorObject
,
governorIndex
,
dependentObject
,
dependentIndex
](
const
Config
&
config
,
const
Action
&
action
)
auto
appliable
=
[
governorObject
,
governorIndex
,
dependentObject
,
dependentIndex
](
const
Config
&
config
,
const
Action
&
)
{
if
(
!
config
.
hasRelativeWordIndex
(
governorObject
,
governorIndex
)
or
!
config
.
hasRelativeWordIndex
(
dependentObject
,
dependentIndex
))
return
false
;
...
...
@@ -815,15 +815,6 @@ Action Action::attach(Config::Object governorObject, int governorIndex, Config::
if
(
!
util
::
isEmpty
(
config
.
getAsFeature
(
Config
::
headColName
,
depLineIndex
)))
return
false
;
// Check for cycles
// while (govLineIndex != depLineIndex)
// {
// try
// {
// govLineIndex = std::stoi(config.getAsFeature(Config::headColName, govLineIndex));
// } catch(std::exception &) {return true;}
// }
return
true
;
};
...
...
@@ -859,7 +850,7 @@ Action Action::split(int index)
Action
Action
::
setRootUpdateIdsEmptyStackIfSentChanged
()
{
auto
apply
=
[](
Config
&
config
,
Action
&
a
)
auto
apply
=
[](
Config
&
config
,
Action
&
)
{
int
lineIndex
=
config
.
getWordIndex
();
int
rootIndex
=
lineIndex
;
...
...
@@ -934,7 +925,7 @@ Action Action::setRootUpdateIdsEmptyStackIfSentChanged()
config
.
popStack
();
};
auto
undo
=
[](
Config
&
config
,
Action
&
a
)
auto
undo
=
[](
Config
&
,
Action
&
)
{
//TODO undo this
};
...
...
@@ -960,7 +951,7 @@ Action Action::deprel(std::string value)
addHypothesis
(
Config
::
deprelColName
,
config
.
getLastAttached
(),
""
).
undo
(
config
,
a
);
};
auto
appliable
=
[](
const
Config
&
config
,
const
Action
&
action
)
auto
appliable
=
[](
const
Config
&
config
,
const
Action
&
)
{
return
config
.
has
(
0
,
config
.
getLastAttached
(),
0
);
};
...
...
@@ -1062,7 +1053,7 @@ Action Action::uppercaseIndex(std::string col, Config::Object obj, int index, in
addHypothesis
(
col
,
lineIndex
,
fmt
::
format
(
"{}"
,
res
)).
apply
(
config
,
a
);
};
auto
undo
=
[
col
,
obj
,
index
](
Config
&
config
,
Action
&
a
)
auto
undo
=
[
col
,
obj
,
index
](
Config
&
config
,
Action
&
)
{
int
lineIndex
=
config
.
getRelativeWordIndex
(
obj
,
index
);
auto
&
value
=
config
.
getLastNotEmptyHyp
(
col
,
lineIndex
);
...
...
@@ -1126,7 +1117,7 @@ Action Action::lowercaseIndex(std::string col, Config::Object obj, int index, in
addHypothesis
(
col
,
lineIndex
,
fmt
::
format
(
"{}"
,
res
)).
apply
(
config
,
a
);
};
auto
undo
=
[
col
,
obj
,
index
](
Config
&
config
,
Action
&
a
)
auto
undo
=
[
col
,
obj
,
index
](
Config
&
config
,
Action
&
)
{
int
lineIndex
=
config
.
getRelativeWordIndex
(
obj
,
index
);
auto
&
value
=
config
.
getLastNotEmptyHyp
(
col
,
lineIndex
);
...
...
This diff is collapsed.
Click to expand it.
torch_modules/src/CNN.cpp
+
1
−
1
View file @
b882e02b
#include
"CNN.hpp"
#include
"fmt/core.h"
CNNImpl
::
CNNImpl
(
int
inputSize
,
int
outputSize
,
ModuleOptions
options
)
:
outputSize
(
outputSize
)
CNNImpl
::
CNNImpl
(
int
inputSize
,
int
outputSize
,
ModuleOptions
)
:
outputSize
(
outputSize
)
{
for
(
auto
&
windowSize
:
windowSizes
)
{
...
...
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