Browse Source

Merge branch 'dev' of ssh://git.nju.edu.cn/learnware/learnware-market into dev

tags/v0.3.2
liuht 3 years ago
parent
commit
d014ff19af
3 changed files with 4 additions and 2 deletions
  1. +1
    -1
      examples/example_image/main.py
  2. +2
    -1
      examples/example_m5/example_init.py
  3. +1
    -0
      examples/example_pfs/example_init.py

+ 1
- 1
examples/example_image/main.py View File

@@ -200,4 +200,4 @@ def test_search(gamma=0.1, load_market=True):
if __name__ == "__main__":
# prepare_data()
# prepare_model()
test_search(load_market=True)
test_search(load_market=False)

+ 2
- 1
examples/example_m5/example_init.py View File

@@ -1,6 +1,7 @@
import os
import joblib
import numpy as np
import lightgbm as lgb
from learnware.model import BaseModel


@@ -8,7 +9,7 @@ class Model(BaseModel):
def __init__(self):
super(Model, self).__init__(input_shape=(82,), output_shape=())
dir_path = os.path.dirname(os.path.abspath(__file__))
self.model = joblib.load(os.path.join(dir_path, "model.out"))
self.model = lgb.Booster(model_file=os.path.join(dir_path, "model.out"))

def fit(self, X: np.ndarray, y: np.ndarray):
pass


+ 1
- 0
examples/example_pfs/example_init.py View File

@@ -6,6 +6,7 @@ from learnware.model import BaseModel

class Model(BaseModel):
def __init__(self):
super(Model, self).__init__(input_shape=(31,), output_shape=())
dir_path = os.path.dirname(os.path.abspath(__file__))
self.model = joblib.load(os.path.join(dir_path, "model.out"))



Loading…
Cancel
Save