Skip to content

Commit

Permalink
update nni hpo docs (#299)
Browse files Browse the repository at this point in the history
* update docs

* update docs

* update docs
  • Loading branch information
yjjinjie authored Nov 5, 2022
1 parent faba36c commit 272bd12
Show file tree
Hide file tree
Showing 8 changed files with 363 additions and 247 deletions.
Binary file added docs/images/automl/best-model.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/automl/exp-list.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/automl/nni-compare.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/automl/nni-install.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
555 changes: 335 additions & 220 deletions docs/source/automl/pai_nni_hpo.md

Large diffs are not rendered by default.

51 changes: 26 additions & 25 deletions easy_rec/python/test/predictor_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,31 +303,32 @@ def test_local_pred_rtp_with_part_col(self):

@RunAsSubprocess
def test_local_pred_embedding(self):
test_input_path = 'data/test/inference/taobao_item_feature_data.csv'
self._test_output_path = os.path.join(self._test_dir, 'taobao_item_feature')
saved_model_dir = 'data/test/inference/dssm_item_model/'
pipeline_config_path = os.path.join(saved_model_dir,
'assets/pipeline.config')
pipeline_config = config_util.get_configs_from_pipeline_file(
pipeline_config_path, False)
predictor = CSVPredictor(
saved_model_dir,
pipeline_config.data_config,
ds_vector_recall=True,
output_sep=';',
selected_cols='pid,adgroup_id,cate_id,campaign_id,customer,brand,price')

predictor.predict_impl(
test_input_path,
self._test_output_path,
reserved_cols='adgroup_id',
output_cols='item_emb',
slice_id=0,
slice_num=1)

with open(self._test_output_path + '/part-0.csv', 'r') as f:
output_res = f.readlines()
self.assertTrue(output_res[1] ==
test_input_path = 'data/test/inference/taobao_item_feature_data.csv'
self._test_output_path = os.path.join(self._test_dir, 'taobao_item_feature')
saved_model_dir = 'data/test/inference/dssm_item_model/'
pipeline_config_path = os.path.join(saved_model_dir,
'assets/pipeline.config')
pipeline_config = config_util.get_configs_from_pipeline_file(
pipeline_config_path, False)
predictor = CSVPredictor(
saved_model_dir,
pipeline_config.data_config,
ds_vector_recall=True,
output_sep=';',
selected_cols='pid,adgroup_id,cate_id,campaign_id,customer,brand,price')

predictor.predict_impl(
test_input_path,
self._test_output_path,
reserved_cols='adgroup_id',
output_cols='item_emb',
slice_id=0,
slice_num=1)

with open(self._test_output_path + '/part-0.csv', 'r') as f:
output_res = f.readlines()
self.assertTrue(
output_res[1] ==
'-0.187066,-0.027638,-0.117294,0.115318,-0.273561,0.035698,-0.055832,'
'0.226849,-0.105808,-0.152751,0.081528,-0.183329,0.134619,0.185392,'
'0.096774,0.104428,0.161868,0.269710,-0.268538,0.138760,-0.170105,'
Expand Down
2 changes: 1 addition & 1 deletion easy_rec/python/test/train_eval_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
import threading
import time
import unittest
from distutils.version import LooseVersion

import numpy as np
import six
import tensorflow as tf
from distutils.version import LooseVersion
from tensorflow.python.platform import gfile

from easy_rec.python.main import predict
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ multi_line_output = 7
force_single_line = true
known_standard_library = setuptools
known_first_party = easy_rec
known_third_party = absl,common_io,docutils,future,google,graphlearn,kafka,matplotlib,numpy,oss2,pai,pandas,psutil,six,sklearn,sphinx_markdown_tables,sphinx_rtd_theme,tensorflow,yaml
known_third_party = absl,common_io,distutils,docutils,future,google,graphlearn,kafka,matplotlib,numpy,oss2,pai,pandas,psutil,six,sklearn,sphinx_markdown_tables,sphinx_rtd_theme,tensorflow,yaml
no_lines_before = LOCALFOLDER
default_section = THIRDPARTY
skip = easy_rec/python/protos
Expand Down

0 comments on commit 272bd12

Please sign in to comment.