Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into load_model_path
Browse files Browse the repository at this point in the history
  • Loading branch information
bassmang committed Jul 25, 2023
2 parents 84d4869 + 89c4424 commit 65d9a0c
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 6 deletions.
1 change: 1 addition & 0 deletions docs/source/vw_versions.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ The package also exports both the VW version and commit used which can be read u
| `0.4.0` | `9.8.0` | [`4715756`](https://github.com/VowpalWabbit/vowpal_wabbit/commits/4715756) |
| `0.4.1` | `9.8.0` | [`b8c4ee3`](https://github.com/VowpalWabbit/vowpal_wabbit/commits/b8c4ee3) |
| `0.5.0` | `9.8.0` | [`b8c4ee3`](https://github.com/VowpalWabbit/vowpal_wabbit/commits/b8c4ee3) |
| `0.6.0` | `9.9.0` | [`9db1f5f`](https://github.com/VowpalWabbit/vowpal_wabbit/commits/9db1f5f) |
2 changes: 1 addition & 1 deletion ext_libs/vowpal_wabbit
Submodule vowpal_wabbit updated 58 files
+2 −2 test/pred-sets/ref/aml_spinoff.inv
+2 −2 test/pred-sets/ref/aml_spinoff_bag.inv
+2 −2 test/pred-sets/ref/ccb_implicit_and_explicit_interactions.inv
+2 −2 test/pred-sets/ref/ccb_implicit_explicit_ignore_interactions.inv
+2 −2 test/pred-sets/ref/ccb_lots_of_interactions.inv
+2 −2 test/pred-sets/ref/ccb_quad.inv
+2 −2 test/pred-sets/ref/ccb_quad_save_resume.inv
+2 −2 test/pred-sets/ref/ep_dec_spinoff.inv
+1 −1 test/pred-sets/ref/igl_spinoff.inv
+1 −1 test/pred-sets/ref/readable_model_privacy.txt
+1 −1 test/pred-sets/ref/readable_model_privacy_no_tags.txt
+2 −2 test/pred-sets/ref/slates_w_interactions.inv
+2 −2 test/pred-sets/ref/t288.readable
+2 −2 test/test-sets/ref/0001_ftrl.stderr
+2 −2 test/test-sets/ref/0001_ftrl_holdout_106.stderr
+2 −2 test/test-sets/ref/0001_ftrl_holdout_off.stderr
+2 −2 test/train-sets/ref/automl_readable.txt
+2 −2 test/train-sets/ref/automl_readable_cubic.txt
+2 −2 test/train-sets/ref/automl_readable_qc.txt
+2 −2 test/train-sets/ref/cbadf_automl_readable.txt
+1 −1 test/train-sets/ref/cbadf_automl_readable_predictonly.txt
+2 −2 test/train-sets/ref/cbzo_constant_invert_hash.txt
+2 −2 test/train-sets/ref/cbzo_constant_readable_model.txt
+2 −2 test/train-sets/ref/cbzo_linear_invert_hash.txt
+2 −2 test/train-sets/ref/cbzo_linear_readable_model.txt
+2 −2 test/train-sets/ref/coin.readable
+2 −2 test/train-sets/ref/coin_model_overflow.invert.txt
+2 −2 test/train-sets/ref/dupeindex_self_cubic.txt
+2 −2 test/train-sets/ref/dupeindex_self_quadratic.txt
+2 −2 test/train-sets/ref/dupeindex_self_quartic.txt
+4 −4 test/train-sets/ref/ftrl.readable
+2 −2 test/train-sets/ref/ftrl_audit_regr.stderr
+1 −1 test/train-sets/ref/igl_2.readable
+2 −2 test/train-sets/ref/ignore_feature.interactions
+2 −2 test/train-sets/ref/ignore_feature_default_ns.interactions
+2 −2 test/train-sets/ref/ignore_multiple_features.interactions
+2 −2 test/train-sets/ref/inv_hash_load_model.invert.txt
+2 −2 test/train-sets/ref/inv_hash_load_model.readable.txt
+2 −2 test/train-sets/ref/l1_l2_default_model.txt
+2 −2 test/train-sets/ref/l1_l2_override_model.txt
+2 −2 test/train-sets/ref/l1_override_l2_leave_model.txt
+2 −2 test/train-sets/ref/l1l2_migrate.txt
+2 −2 test/train-sets/ref/l1l2_migrate_override.txt
+2 −2 test/train-sets/ref/marginal_invert_hash_readable_model.txt
+2 −2 test/train-sets/ref/pistol.readable
+5 −5 test/train-sets/ref/search_dep_parser_one_learner.stderr
+2 −2 test/train-sets/ref/w_out_slot_ns.interactions
+1 −1 vcpkg.json
+1 −1 version.txt
+3 −2 vowpalwabbit/core/src/reductions/ftrl.cc
+3 −1 vowpalwabbit/core/tests/cb_graph_feedback_label_parse_test.cc
+3 −1 vowpalwabbit/core/tests/cb_graph_feedback_test.cc
+1 −0 wasm/README.md
+1 −0 wasm/developer_readme.md
+1 −1 wasm/package.json
+50 −35 wasm/src/vw.ts
+46 −1 wasm/src/wasm_wrapper.cc
+36 −0 wasm/test/test.js
4 changes: 4 additions & 0 deletions src/cpp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,9 @@ void py_unsetup_example(VW::workspace& ws, VW::example& ex)
case VW::label_type_t::CB:
replacement.cb = std::move(ex.l.cb);
break;
case VW::label_type_t::CB_WITH_OBSERVATIONS:
replacement.cb_with_observations = std::move(ex.l.cb_with_observations);
break;
case VW::label_type_t::CB_EVAL:
replacement.cb_eval = std::move(ex.l.cb_eval);
break;
Expand Down Expand Up @@ -890,6 +893,7 @@ PYBIND11_MODULE(_core, m)
.value("Simple", VW::label_type_t::SIMPLE)
.value("CB", VW::label_type_t::CB)
.value("CBEval", VW::label_type_t::CB_EVAL)
.value("CBWithObservations", VW::label_type_t::CB_WITH_OBSERVATIONS)
.value("CS", VW::label_type_t::CS)
.value("Multilabel", VW::label_type_t::MULTILABEL)
.value("Multiclass", VW::label_type_t::MULTICLASS)
Expand Down
9 changes: 5 additions & 4 deletions src/vowpal_wabbit_next/_core.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,7 @@ class LabelType():
"""
CB: vowpal_wabbit_next._core.LabelType # value = <LabelType.CB: 1>
CBEval: vowpal_wabbit_next._core.LabelType # value = <LabelType.CBEval: 2>
CBWithObservations: vowpal_wabbit_next._core.LabelType # value = <LabelType.CBWithObservations: 3>
CCB: vowpal_wabbit_next._core.LabelType # value = <LabelType.CCB: 7>
CS: vowpal_wabbit_next._core.LabelType # value = <LabelType.CS: 4>
Continuous: vowpal_wabbit_next._core.LabelType # value = <LabelType.Continuous: 10>
Expand All @@ -348,7 +349,7 @@ class LabelType():
NoLabel: vowpal_wabbit_next._core.LabelType # value = <LabelType.NoLabel: 9>
Simple: vowpal_wabbit_next._core.LabelType # value = <LabelType.Simple: 0>
Slates: vowpal_wabbit_next._core.LabelType # value = <LabelType.Slates: 8>
__members__: dict # value = {'Simple': <LabelType.Simple: 0>, 'CB': <LabelType.CB: 1>, 'CBEval': <LabelType.CBEval: 2>, 'CS': <LabelType.CS: 4>, 'Multilabel': <LabelType.Multilabel: 5>, 'Multiclass': <LabelType.Multiclass: 6>, 'CCB': <LabelType.CCB: 7>, 'Slates': <LabelType.Slates: 8>, 'NoLabel': <LabelType.NoLabel: 9>, 'Continuous': <LabelType.Continuous: 10>}
__members__: dict # value = {'Simple': <LabelType.Simple: 0>, 'CB': <LabelType.CB: 1>, 'CBEval': <LabelType.CBEval: 2>, 'CBWithObservations': <LabelType.CBWithObservations: 3>, 'CS': <LabelType.CS: 4>, 'Multilabel': <LabelType.Multilabel: 5>, 'Multiclass': <LabelType.Multiclass: 6>, 'CCB': <LabelType.CCB: 7>, 'Slates': <LabelType.Slates: 8>, 'NoLabel': <LabelType.NoLabel: 9>, 'Continuous': <LabelType.Continuous: 10>}
pass
class ModelDelta():
def __init__(self, model_data: bytes) -> None: ...
Expand Down Expand Up @@ -514,6 +515,6 @@ def _write_cache_example(workspace: Workspace, example: Example, file: object) -
pass
def _write_cache_header(workspace: Workspace, file: object) -> None:
pass
__version__ = '0.5.0'
_vw_commit = 'b8c4ee3'
_vw_version = '9.8.0'
__version__ = '0.6.0'
_vw_commit = '9db1f5f'
_vw_version = '9.9.0'
23 changes: 23 additions & 0 deletions tests/test_learn.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,26 @@ def test_oaa_learn_crash():

for line in dataset:
workspace.learn_one(parser.parse_line(line))


def test_igl_predict_and_learn():
dsjson_input = """{"_label_cost": 0, "_label_probability": 0.25, "_label_Action": 1, "_labelIndex": 0, "o": [{"v": {"v=click": 1}, "_definitely_bad": false}], "a": [0, 1, 2, 3], "c": {"User": {"user=Tom": 1, "time=afternoon" : 1}, "_multi": [{"Action": {"action=politics": 1}}, {"Action": {"action=sports": 1}}, {"Action": {"action=music": 1}}, {"Action": {"action=food": 1}}]}, "p": [0.25, 0.25, 0.25, 0.25]}"""
model = vw.Workspace(
["--cb_explore_adf", "--coin", "--experimental_igl", "-q", "UA"]
)

parser = vw.DSJsonFormatParser(model)
examples = parser.parse_json(dsjson_input)

assert len(examples) == 6

pred = model.predict_one(examples)
assert all([p == 0.25 for _, p in pred])
model.learn_one(examples)

assert (
model.weights()[
model.get_index_for_scalar_feature("user=Tom", namespace_name="User")
][0][0]
!= 0
)
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.5.0
0.6.0

0 comments on commit 65d9a0c

Please sign in to comment.