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

[FEATURE REQUEST] Archive of Classes #287

Closed
whitead opened this issue Jan 1, 2023 · 4 comments
Closed

[FEATURE REQUEST] Archive of Classes #287

whitead opened this issue Jan 1, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@whitead
Copy link

whitead commented Jan 1, 2023

Description

I'm not sure if this makes sense for the QDL QD algorithm, but I would like to generate diversity for multi-label classification. That is, each sample x has a binary vector of labels (length ~15-50). I would like to generate a diversity of these binary vectors. I can probably just use the CVTArchive with one-hot vectors, but I was curious if there is a better way, or if this will make sense with the QDL QD algorithm.

Thank you!

@whitead whitead added the enhancement New feature or request label Jan 1, 2023
@btjanaka
Copy link
Member

btjanaka commented Jan 1, 2023

Hi @whitead, thanks for using pyribs. I think it may help to first formalize your problem a bit so that I can better understand it. What are your objectives, measures / behaviors, and solution vectors? Right now, it seems like your binary vector of labels may either be the measures or the solution vectors.

I am also not familiar with the QDL algorithm; would you mind sharing the relevant paper?

@whitead
Copy link
Author

whitead commented Jan 1, 2023

Thanks for the quick response! Sorry QDL meant Quality Diversity. Not sure what the L was supposed to stand for in my head...

In my setting, the features/actions x are 2-3 points in a low-dimensional space. Kind of like the robot arm example. To be concrete, take x be 3 2D points, written as x = [-2, 3, 2.5, 1, 0, 3].

The objective is a value between 0 and 1.

After running my simulator given x, it returns both the objective and a set of integers representing properties. Examples of return values for the properties are (1,5,3) or () or (1,27,4) (order is irrelevant). These properties are like multi-label classification. I would like my behavior/archive to be these properties. So I could represent them as a binary vector - (1,5,3) => [0, 1, 0, 1, 0, 1, 0, ....] where the length is the number of possible properties (~15-100 depending on simulator parameters).

I was thinking then my archive could be a grid, where the two bins are 0/1, but that might not behave well with D = 100 I think. Another possibility is the CVTArchive - however I may need to replace the distance with a binary-vector distance measure (e.g., Jaccard Index).

My question for you is if this sounds reasonable and have you come across a case where the behaviors are binary vectors. And, if CVTArchive is reasonable, how I might modify the distance for comparing the vectors. Thanks!

@btjanaka
Copy link
Member

btjanaka commented Jan 1, 2023

Your approach certainly sounds reasonable. If you have a 100-dimensional archive, CVTArchive is a good choice. I'm not sure how useful our CMA-based algorithms will be since we have not really used them with binary behaviors, only discrete ones, but it is certainly worth a try. I'd suggest running with the bounds set to (0, 1) in each dimension. Maybe try out CMA-ME (I assume you're using v0.4.0, but we'll have CMA-MAE in v0.5.0) and MAP-Elites. I would not suggest modifying the CVTArchive's distance metric immediately as that would be very involved (we designed everything around Euclidean distance in that archive).

@whitead
Copy link
Author

whitead commented Jan 6, 2023

Thanks for your help @btjanaka - I'll reopen if I have additional questions.

@whitead whitead closed this as completed Jan 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants