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
957484a8
Commit
957484a8
authored
Jun 17, 2019
by
alison-carrera
Browse files
Changes in exploration.
parent
f0f74d94
Changes
1
Hide whitespace changes
Inline
Side-by-side
onn/OnlineNeuralNetwork.py
View file @
957484a8
...
@@ -150,9 +150,12 @@ class ONN(nn.Module):
...
@@ -150,9 +150,12 @@ 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
and
pred
.
shape
[
0
]
==
1
:
if
self
.
use_exploration
and
np
.
random
.
uniform
()
<
self
.
e
and
self
.
batch_size
==
1
:
removed_arms
=
self
.
arms_values
.
copy
()
removed_arms
=
self
.
arms_values
.
copy
()
removed_arms
.
remove
(
pred
)
removed_arms
.
remove
(
pred
[
0
]
)
return
random
.
choice
(
removed_arms
)
return
random
.
choice
(
removed_arms
)
if
self
.
batch_size
==
1
:
return
pred
[
0
]
return
pred
return
pred
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