Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
张 建国
onn在线训练
Commits
9da59d47
Commit
9da59d47
authored
Jun 17, 2019
by
alison-carrera
Browse files
Added new conditions in exploration predict.
parent
3831ecd4
Changes
1
Hide whitespace changes
Inline
Side-by-side
onn/OnlineNeuralNetwork.py
View file @
9da59d47
...
@@ -150,7 +150,7 @@ class ONN(nn.Module):
...
@@ -150,7 +150,7 @@ class ONN(nn.Module):
def
predict
(
self
,
X_data
):
def
predict
(
self
,
X_data
):
pred
=
self
.
predict_
(
X_data
)
pred
=
self
.
predict_
(
X_data
)
if
self
.
use_exploration
and
np
.
random
.
uniform
()
<
self
.
e
:
if
self
.
use_exploration
and
np
.
random
.
uniform
()
<
self
.
e
and
pred
.
shape
[
0
]
==
1
:
removed_arms
=
self
.
arms_values
.
copy
()
removed_arms
=
self
.
arms_values
.
copy
()
removed_arms
.
remove
(
pred
)
removed_arms
.
remove
(
pred
)
return
random
.
choice
(
removed_arms
)
return
random
.
choice
(
removed_arms
)
...
...
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