Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RL-Parsing
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
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Franck Dary
RL-Parsing
Commits
6a6cd177
Commit
6a6cd177
authored
3 years ago
by
Franck Dary
Browse files
Options
Downloads
Patches
Plain Diff
Revert changes to config's debug print format that broke script readTrace
parent
423c26c3
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Config.py
+4
-5
4 additions, 5 deletions
Config.py
Train.py
+0
-1
0 additions, 1 deletion
Train.py
with
4 additions
and
6 deletions
Config.py
+
4
−
5
View file @
6a6cd177
...
@@ -86,17 +86,16 @@ class Config :
...
@@ -86,17 +86,16 @@ class Config :
def
__len__
(
self
)
:
def
__len__
(
self
)
:
return
len
(
self
.
lines
)
return
len
(
self
.
lines
)
# This print format is used by the script readTrace.py, avoid changes
def
printForDebug
(
self
,
output
)
:
def
printForDebug
(
self
,
output
)
:
printedCols
=
[
"
ID
"
,
"
FORM
"
,
"
UPOS
"
,
"
HEAD
"
,
"
DEPREL
"
]
printedCols
=
[
"
ID
"
,
"
FORM
"
,
"
UPOS
"
,
"
HEAD
"
,
"
DEPREL
"
]
left
=
5
left
=
5
right
=
5
right
=
5
historySize
=
8
historyPopSize
=
6
print
(
"
state :
"
,
self
.
state
,
file
=
output
)
print
(
"
state :
"
,
self
.
state
,
file
=
output
)
print
(
"
stack :
"
,[
int
(
self
.
getAsFeature
(
ind
,
"
ID
"
)
)
for
ind
in
self
.
stack
],
file
=
output
)
print
(
"
stack :
"
,[
self
.
getAsFeature
(
ind
,
"
ID
"
)
for
ind
in
self
.
stack
],
file
=
output
)
print
(
"
nbUndone :
"
,
self
.
nbUndone
,
file
=
output
)
print
(
"
nbUndone :
"
,
self
.
nbUndone
,
file
=
output
)
print
(
"
history :
"
,[
str
(
trans
)
for
trans
in
self
.
history
[
-
historySize
:]
],
file
=
output
)
print
(
"
history :
"
,[
str
(
trans
)
for
trans
in
self
.
history
],
file
=
output
)
print
(
"
historyPop :
"
,[(
str
(
c
[
0
]),
"
reward:
"
+
str
(
c
[
3
]))
for
c
in
self
.
historyPop
[
-
historyPopSize
:]
],
file
=
output
)
print
(
"
historyPop :
"
,[(
str
(
c
[
0
]),
"
dat:
"
+
str
(
c
[
1
]),
"
mvt:
"
+
str
(
c
[
2
]),
"
reward:
"
+
str
(
c
[
3
]),
"
state:
"
+
str
(
c
[
4
]))
for
c
in
self
.
historyPop
],
file
=
output
)
toPrint
=
[]
toPrint
=
[]
for
lineIndex
in
range
(
self
.
wordIndex
-
left
,
self
.
wordIndex
+
right
)
:
for
lineIndex
in
range
(
self
.
wordIndex
-
left
,
self
.
wordIndex
+
right
)
:
if
lineIndex
not
in
range
(
len
(
self
.
lines
))
:
if
lineIndex
not
in
range
(
len
(
self
.
lines
))
:
...
...
This diff is collapsed.
Click to expand it.
Train.py
+
0
−
1
View file @
6a6cd177
...
@@ -271,7 +271,6 @@ def trainModelRl(debug, networkName, modelDir, filename, nbIter, batchSize, devF
...
@@ -271,7 +271,6 @@ def trainModelRl(debug, networkName, modelDir, filename, nbIter, batchSize, devF
probaOracle
=
list_probas
[
fromState
][
1
]
probaOracle
=
list_probas
[
fromState
][
1
]
if
debug
:
if
debug
:
print
(
"
-
"
*
80
,
file
=
sys
.
stderr
)
sentence
.
printForDebug
(
sys
.
stderr
)
sentence
.
printForDebug
(
sys
.
stderr
)
action
=
selectAction
(
policy_net
,
state
,
transitionSet
,
sentence
,
missingLinks
,
probaRandom
,
probaOracle
,
fromState
)
action
=
selectAction
(
policy_net
,
state
,
transitionSet
,
sentence
,
missingLinks
,
probaRandom
,
probaOracle
,
fromState
)
...
...
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