Commit 308d9161 authored by 高雅喆's avatar 高雅喆

add log to log_maidian

parent 5f5e6968
......@@ -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))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment