Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
physical
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
physical
Commits
308d9161
Commit
308d9161
authored
Sep 17, 2019
by
高雅喆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add log to log_maidian
parent
5f5e6968
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
linucb.py
linucb/views/linucb.py
+5
-0
No files found.
linucb/views/linucb.py
View file @
308d9161
...
...
@@ -11,6 +11,7 @@ import json
import
pickle
from
django.conf
import
settings
from
libs.error
import
logging_exception
from
gm_logging.general
import
log_maidian
class
LinUCB
:
d
=
2
...
...
@@ -150,8 +151,12 @@ class LinUCB:
ori_redis_tag_data
=
redis_cli
.
hget
(
redis_key
,
tag_id
)
if
not
ori_redis_tag_data
:
log_dict
=
{
"device_id"
:
device_id
,
"tag_id"
:
tag_id
,
"ltype"
:
"create"
}
log_maidian
(
log_dict
,
'physical'
)
LinUCB
.
init_device_id_linucb_info
(
redis_client
,
redis_prefix
,
device_id
,[
tag_id
])
else
:
log_dict
=
{
"device_id"
:
device_id
,
"tag_id"
:
tag_id
,
"ltype"
:
"update"
}
log_maidian
(
log_dict
,
'physical'
)
ori_redis_tag_dict
=
pickle
.
loads
(
ori_redis_tag_data
)
new_Aa_matrix
=
ori_redis_tag_dict
[
"Aa"
]
+
np
.
dot
(
xa
,
xaT
)
new_AaI_matrix
=
np
.
linalg
.
solve
(
new_Aa_matrix
,
np
.
identity
(
cls
.
d
))
...
...
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