You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add possibility to change the size of environment. Currently, if you change SIZE to be equal 1, you stuck in infinite loop waiting for "good configuration", as the inital coordinates are chosen randomly from some large square that does not depend on SIZE. Also, I believe radius of balls should be scaled with respect to SIZE.
Add vnorm option that defines the norm of the initial velocity vectors.
Vectorize make_steps and make_frames, i.e. they have to accept parameter num_samples and create an appropriate [num_samples, ...] tensors. Currently, only one series of frames is generated, so to generate e.g. 10000 samples I have to run make_steps or make_frames in a loop, that makes things slow. I believe that proper vectorized implementation can be much faster. I'm personally interested currently in vectorized make_steps (to obtain coordinates of balls), but make_frames also should be vectorized. This also demand vectorization of self.x and self.v.
The text was updated successfully, but these errors were encountered:
@ischurov, here are some comments on your features:
I believe that the size of the grid is controlled by SIZE, and if the SIZE is too small, then it's impossible to get balls are small enough to be in the environment, you can pass the parameter r to control the radius. Current default r is 1.2 for each ball, but you can configure them as other sizes too.
I've added a self.vnorm for taking the norm of the initial velocity.
I will find another time to vectorize make_steps and make_frames, I think I can vectorize most of the parts.
Fixing r does not work, I tried it. We have problems on this line
while not good_config:
x = 2+np.random.rand(self.n, 2)*8
Here numbers 2 and 8 are hardcoded, but they should depend on r as well, I believe. Otherwise, we are trying to put the ball outside of the allowed region.
vnorm
option that defines the norm of the initial velocity vectors.make_steps
andmake_frames
, i.e. they have to accept parameternum_samples
and create an appropriate[num_samples, ...]
tensors. Currently, only one series of frames is generated, so to generate e.g. 10000 samples I have to runmake_steps
ormake_frames
in a loop, that makes things slow. I believe that proper vectorized implementation can be much faster. I'm personally interested currently in vectorizedmake_steps
(to obtain coordinates of balls), butmake_frames
also should be vectorized. This also demand vectorization of self.x and self.v.The text was updated successfully, but these errors were encountered: