Browse Source

[MNT] add a dependency and modify import

tags/v0.3.2
Gene 2 years ago
parent
commit
e0e5a05de2
9 changed files with 10 additions and 12 deletions
  1. +0
    -1
      learnware/market/easy/searcher.py
  2. +0
    -2
      learnware/market/heterogeneous/organizer/hetero_mapping/__init__.py
  3. +1
    -1
      learnware/market/heterogeneous/searcher.py
  4. +1
    -1
      learnware/reuse/averaging.py
  5. +1
    -1
      learnware/reuse/ensemble_pruning.py
  6. +1
    -1
      learnware/reuse/feature_augment_reuser.py
  7. +2
    -2
      learnware/reuse/hetero_reuser/__init__.py
  8. +3
    -3
      learnware/reuse/hetero_reuser/feature_alignment.py
  9. +1
    -0
      setup.py

+ 0
- 1
learnware/market/easy/searcher.py View File

@@ -435,7 +435,6 @@ class EasyStatSearcher(BaseSearcher):
):
continue

# TODO: must we check dim for Text and Image specification?
rkme_dim = str(list(rkme.get_z().shape)[1:])
if rkme_dim == user_rkme_dim:
filtered_learnware_list.append(learnware)


+ 0
- 2
learnware/market/heterogeneous/organizer/hetero_mapping/__init__.py View File

@@ -59,7 +59,6 @@ class HeteroMapping(nn.Module):
device=device,
)

##todo: BUG!!!!!!
self.encoder = TransformerMultiLayer(
hidden_dim=hidden_dim,
num_layer=num_layer,
@@ -404,7 +403,6 @@ class TransformerMultiLayer(nn.Module):
use_layer_norm=True,
activation=activation,
)
##todo: BUG!!!!!!
stacked_transformer = nn.TransformerEncoder(encoder_layer, num_layers=num_layer - 1)
self.transformer_encoder.append(stacked_transformer)



+ 1
- 1
learnware/market/heterogeneous/searcher.py View File

@@ -69,7 +69,7 @@ class HeteroMapTableSearcher(EasySearcher):
learnware_list: List[Learnware],
user_info: BaseUserInfo,
) -> Tuple[List[float], List[Learnware], float, List[Learnware]]:
# todo: use specially assigned search_gamma for calculating mmd dist
# TODO: use specially assigned search_gamma for calculating mmd dist
user_hetero_spec = self.learnware_oganizer.generate_hetero_map_spec(user_info)
logger.info(f"After semantic search, learnware_list length is {len(learnware_list)}")



+ 1
- 1
learnware/reuse/averaging.py View File

@@ -4,7 +4,7 @@ from typing import List
from scipy.special import softmax


from learnware.learnware import Learnware
from ..learnware import Learnware
from .base import BaseReuser
from ..logger import get_module_logger



+ 1
- 1
learnware/reuse/ensemble_pruning.py View File

@@ -4,7 +4,7 @@ import numpy as np
import geatpy as ea
from typing import List

from learnware.learnware import Learnware
from ..learnware import Learnware
from .base import BaseReuser
from ..logger import get_module_logger



+ 1
- 1
learnware/reuse/feature_augment_reuser.py View File

@@ -2,7 +2,7 @@ import numpy as np

from sklearn.linear_model import RidgeCV, LogisticRegressionCV
from .base import BaseReuser
from learnware.learnware import Learnware
from ..learnware import Learnware


class FeatureAugmentReuser(BaseReuser):


+ 2
- 2
learnware/reuse/hetero_reuser/__init__.py View File

@@ -1,5 +1,5 @@
from learnware.learnware import Learnware
from learnware.reuse.base import BaseReuser
from ...learnware import Learnware
from ..base import BaseReuser
from .feature_alignment import FeatureAligner
from ..feature_augment_reuser import FeatureAugmentReuser



+ 3
- 3
learnware/reuse/hetero_reuser/feature_alignment.py View File

@@ -7,9 +7,9 @@ import torch
import time
from tqdm import trange

from learnware.learnware import Learnware
from learnware.specification import RKMETableSpecification
from learnware.specification.regular.table.rkme import choose_device
from ...learnware import Learnware
from ...specification import RKMETableSpecification
from ...specification.regular.table.rkme import choose_device

from ..base import BaseReuser
from ...logger import get_module_logger


+ 1
- 0
setup.py View File

@@ -66,6 +66,7 @@ REQUIRED = [
"rapidfuzz>=3.4.0",
"langdetect>=1.0.9",
"huggingface-hub<0.18",
"transformers>=4.34.1",
"portalocker>=2.0.0",
"qpsolvers[clarabel]>=4.0.1",
]


Loading…
Cancel
Save