Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: [LAS] filter out (potentially) more actions than d based on singular values #4234

Merged
merged 4 commits into from
Oct 20, 2022

Conversation

olgavrou
Copy link
Collaborator

@olgavrou olgavrou commented Oct 19, 2022

  • As the singular values taper off to zero then the spanner with be picking randomly from the remaining actions and in theory they are redundant, so use the number of actions that make the 99% of the sum of the singular values and select that many actions in the spanner
    • this means that for a num_actions ~ > than the matrix rank we don't have to tune num_actions since results should be the same
  • also make default thread pool size is ~ half the available threads (instead of 0)
  • fix some tests that were setting the test seed funny

@@ -138,12 +138,6 @@ BOOST_AUTO_TEST_CASE(check_AO_linear_combination_of_actions)
vw.finish_example(examples);
}

// After the decomposition, the linear combination in the representation of the action in U is maintained for the
Copy link
Collaborator Author

@olgavrou olgavrou Oct 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is taken care of by the core algo now

@@ -40,8 +40,8 @@ void spanner_state::compute_spanner(const Eigen::MatrixXf& U, size_t _d, const s
// Awerbuch & Kleinberg STOC'04: https://www.cs.cornell.edu/~rdk/papers/OLSP.pdf

// The size of U is K x d, where K is the total number of all actions.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here?

_X.setIdentity(_d, _d);
_X_inv.setIdentity(_d, _d);
assert(static_cast<uint64_t>(U.cols()) >= _d);
_X.setIdentity(_d, U.cols());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for example, shall this be _X.setIdentity(U.cols(), U.cols())?

@@ -100,9 +100,9 @@ void one_rank_spanner_state::compute_spanner(
*/

// The size of U is K x d, where K is the total number of all actions
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because U may have more columns than d, i suppose we need to use U.cols() in place of d consistently in spanner computation?
Also need to update the comment here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

synced offline, U is truncated to d before it is returned from one_pass_svd and updated naming in spanner to make things clearer

@olgavrou olgavrou merged commit 7434088 into VowpalWabbit:master Oct 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants