google / evojax

Apache License 2.0
826 stars 78 forks source link

high dimensional parametric search #55

Closed Agnes233 closed 1 year ago

Agnes233 commented 1 year ago

I'm trying to use evojax to evolve my model parameters. I found that the algorithm only accepts the parameter num_dims as the dimension, whether it can only be int type here? If I want to evolve multidimensional parameters, such as [1000x1000] data, how can I do it? Thanks!

lerrytang commented 1 year ago

Hi, thanks for the question. In your case, you can simply specify param_size=1000000 and reshape the result from algo.ask() to $1000\times1000$.

Agnes233 commented 1 year ago

Thank you for your answer. I have tried to call CMA_ES and set num_dims=1000000, an error would be reported:

I don't know what I did wrong, looking forward to your reply!

------------------ 原始邮件 ------------------ 发件人: "google/evojax" @.>; 发送时间: 2022年12月14日(星期三) 上午10:44 @.>; @.**@.>; 主题: Re: [google/evojax] high dimensional parametric search (Issue #55)

Hi, thanks for the question. In your case, you can simply specify param_size=1000000 and reshape the result from algo.ask() to $1000\times1000$.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

lerrytang commented 1 year ago

CMA_ES does not work well with large parameter spaces due to the large memory needed by the covariance matrix. Is your error memory related? Can you try other algos such as PGPE or ARS?

Agnes233 commented 1 year ago

It works, thanks for your reply! What is the maximum number of parameters that evojax can accept?

lerrytang commented 1 year ago

evojax does not put limitation on the number of learnable parameters, however your GPU memory is limited. If you want to evolve a large number of parameters on a GPU with limited memory, reducing the population size will avoid memory errors at the cost of suboptimal solutions (well, they are all suboptimal, so more suboptimal)