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
05acae81
Commit
05acae81
authored
5 years ago
by
Franck Dary
Browse files
Options
Downloads
Patches
Plain Diff
Fixed TODO
parent
15787f04
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
common/src/util.cpp
+0
-1
0 additions, 1 deletion
common/src/util.cpp
decoder/src/Decoder.cpp
+1
-4
1 addition, 4 deletions
decoder/src/Decoder.cpp
trainer/src/Trainer.cpp
+1
-2
1 addition, 2 deletions
trainer/src/Trainer.cpp
with
2 additions
and
7 deletions
common/src/util.cpp
+
0
−
1
View file @
05acae81
...
...
@@ -153,7 +153,6 @@ bool util::doIfNameMatch(const std::regex & reg, std::string_view name, const st
return
true
;
}
//TODO : test this
std
::
string
util
::
strip
(
const
std
::
string
&
s
)
{
std
::
string
striped
;
...
...
This diff is collapsed.
Click to expand it.
decoder/src/Decoder.cpp
+
1
−
4
View file @
05acae81
...
...
@@ -17,10 +17,7 @@ void Decoder::decode(BaseConfig & config, std::size_t beamSize)
auto
context
=
config
.
extractContext
(
5
,
5
,
machine
.
getDict
(
config
.
getState
()));
machine
.
getDict
(
config
.
getState
()).
setState
(
dictState
);
//TODO : check if clone is mandatory
auto
neuralInput
=
torch
::
from_blob
(
context
.
data
(),
{(
long
)
context
.
size
()},
at
::
kLong
).
clone
();
//TODO : check if NoGradGuard does anything
torch
::
NoGradGuard
guard
;
auto
neuralInput
=
torch
::
from_blob
(
context
.
data
(),
{(
long
)
context
.
size
()},
at
::
kLong
);
auto
prediction
=
machine
.
getClassifier
()
->
getNN
()(
neuralInput
);
int
chosenTransition
=
-
1
;
...
...
This diff is collapsed.
Click to expand it.
trainer/src/Trainer.cpp
+
1
−
2
View file @
05acae81
...
...
@@ -21,9 +21,8 @@ void Trainer::createDataset(SubConfig & config)
util
::
myThrow
(
"No transition appliable !"
);
}
//TODO : check if clone is mandatory
auto
context
=
config
.
extractContext
(
5
,
5
,
machine
.
getDict
(
config
.
getState
()));
contexts
.
push
_back
(
torch
::
from_blob
(
context
.
data
(),
{(
long
)
context
.
size
()},
at
::
kLong
).
clone
());
contexts
.
emplace
_back
(
torch
::
from_blob
(
context
.
data
(),
{(
long
)
context
.
size
()},
at
::
kLong
).
clone
());
int
goldIndex
=
machine
.
getTransitionSet
().
getTransitionIndex
(
transition
);
auto
gold
=
torch
::
zeros
(
1
,
at
::
kLong
);
...
...
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