Browse Source

Merge branch 'dev_dependence' of https://github.com/Learnware-LAMDA/Learnware into remove_torch

tags/v0.3.2
bxdd 2 years ago
parent
commit
44aa10f2cf
2 changed files with 6 additions and 4 deletions
  1. +6
    -2
      learnware/reuse/ensemble_pruning.py
  2. +0
    -2
      setup.py

+ 6
- 2
learnware/reuse/ensemble_pruning.py View File

@@ -1,8 +1,6 @@
import torch
import random
import numpy as np
import geatpy as ea

from typing import List

from learnware.learnware import Learnware
@@ -55,6 +53,8 @@ class EnsemblePruningReuser(BaseReuser):
np.ndarray
Binary one-dimensional vector, 1 indicates that the corresponding model is selected.
"""
import geatpy as ea

model_num = v_predict.shape[1]

@ea.Problem.single
@@ -139,6 +139,8 @@ class EnsemblePruningReuser(BaseReuser):
np.ndarray
Binary one-dimensional vector, 1 indicates that the corresponding model is selected.
"""
import geatpy as ea

model_num = v_predict.shape[1]

def find_top_two_freq(row):
@@ -253,6 +255,8 @@ class EnsemblePruningReuser(BaseReuser):
np.ndarray
Binary one-dimensional vector, 1 indicates that the corresponding model is selected.
"""
import geatpy as ea

model_num = v_predict.shape[1]
v_predict[v_predict == 0.0] = -1
v_true[v_true == 0.0] = -1


+ 0
- 2
setup.py View File

@@ -54,7 +54,6 @@ REQUIRED = [
"numpy>=1.20.0",
"pandas>=0.25.1",
"scipy>=1.0.0",
"matplotlib>=3.1.3",
"torch>=1.11.0",
"cvxopt>=1.3.0",
"tqdm>=4.65.0",
@@ -67,7 +66,6 @@ REQUIRED = [
"torchvision>=0.14.1",
"sqlalchemy>=2.0.21",
"shortuuid>=1.0.11",
"geatpy>=2.7.0",
"docker>=6.1.3",
"rapidfuzz>=3.4.0",
"sentence_transformers>=2.2.2",


Loading…
Cancel
Save