Browse Source

[MNT] Modify base reuser

tags/v0.3.2
bxdd 3 years ago
parent
commit
9d3b423900
2 changed files with 12 additions and 2 deletions
  1. +1
    -0
      learnware/learnware/base.py
  2. +11
    -2
      learnware/learnware/reuse.py

+ 1
- 0
learnware/learnware/base.py View File

@@ -61,3 +61,4 @@ class BaseReuser:
np.ndarray
The final prediction for user data with reused learnware
"""
raise NotImplementedError("The predict method is not implemented!")

+ 11
- 2
learnware/learnware/reuse.py View File

@@ -10,13 +10,22 @@ from .base import BaseReuser
from ..specification import RKMEStatSpecification
from ..logger import get_module_logger

logger = get_module_logger("BaseReuser")
logger = get_module_logger("Reuser")


class JobSelectorReuser(BaseReuser):
"""Baseline Multiple Learnware Reuse uing Job Selector Method"""
"""Baseline Multiple Learnware Reuser uing Job Selector Method"""

def __init__(self, learnware_list: List[Learnware], herding_num: int = 1000):
"""The initialization method for job selector reuser

Parameters
----------
learnware_list : List[Learnware]
The learnware list, which should have RKME Specification for each learnweare
herding_num : int, optional
The , by default 1000
"""
super(JobSelectorReuser, self).__init__(learnware_list)
self.herding_num = herding_num



Loading…
Cancel
Save