XR-Transformer refactor and enable cost-sensitive learning via XLinear API/CLI - #64
Merged
Conversation
jiong-zhang
marked this pull request as ready for review
September 28, 2021 04:27
| if "man" in negative_sampling_scheme: | ||
| M += smat_util.binarized(M_pred) | ||
| cur_prob = MLProblem(cur_prob.pX, Y, C=C, M=M, threads=matmul_threads) | ||
| cur_prob = MLProblem(cur_prob.pX, Y, R=R, C=C, M=M, threads=matmul_threads) |
Contributor
There was a problem hiding this comment.
We can merge line 1400 and 1415 into one, if moving line 1415 outside of else?
| nr_splits: int = 2 | ||
| min_codes: int = None # type: ignore | ||
| shallow: bool = False | ||
| relevance_norm: str = "l1" |
Contributor
There was a problem hiding this comment.
as discussed in last meeting, should we use rel_induce and rel_norm to control the hierarchical bahavior of cost-sensitive learning?
| X, | ||
| Y, | ||
| C=None, | ||
| relevance_matrices=None, |
Contributor
There was a problem hiding this comment.
Should we support only a single relevance matrix, but not dictionary form?
| @@ -1,44 +1,104 @@ | |||
| # PECOS eXtreme Multi-label Classification: XTransformer | |||
| # PECOS eXtreme Multi-label Classification: X(R)-Transformer | |||
Contributor
There was a problem hiding this comment.
Let's just use XR-Transformer ?
Contributor
There was a problem hiding this comment.
Also, we can include the .bib now?
| You can also get the fine-tuned text embeddings via: | ||
| ```bash | ||
| > python3 -m pecos.xmc.xlinear.evaluate -y ${Y_path} -p ${Yp_path} -k 10 | ||
| > python3 -m pecos.xmc.xtransformer.predict -t ${Tt_path} -m ${model_dir} -o ${Emb_path} |
Contributor
There was a problem hiding this comment.
should be sth like pecos.xmc.xtransformer.encode?
|
|
||
| ### Advanced Usage: Train/Pred params via json input | ||
| `pecos.xmc.xtransformer` supports accepting training and predicting parameters from an inpyt JSON file. | ||
| Moreover, `python3 -m pecos.xmc.xtransformer.trai` helpfully provide the option to generate all parameters in JSON format to stdout. |
| ``` | ||
|
|
||
| ### Python Example | ||
| This toy example demonstrates how to train and predict with PECOS X(R)-Transformer module using Python API. |
|
|
||
| model_dir (str, optional): the i-th trained matcher will be saved to 'model_dir/{i}.model' | ||
| ranker_level (int, optional): number of ranker levels. Default 1 to use a single layer ranker | ||
| preliminary_indexer_params (HierarchicalKMeans.TrainParams): params to generate preliminary hierarchial label tree. |
Contributor
There was a problem hiding this comment.
Update paper citation in line 43?
jiong-zhang
force-pushed
the
mainline
branch
from
September 30, 2021 21:33
dac88fc to
21a5b54
Compare
OctoberChang
self-requested a review
October 4, 2021 14:22
OctoberChang
approved these changes
Oct 4, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue #, if available:
Description of changes:
Enable Cost-Sensitive Learning via XLinear API/CLI
pecos.xmc.xlinear.trainXR-Transformer refactor
pecos.xmc.xtransformer.encodeOthers
TrainParamsforHierarchicalKMeansBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.