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
Hi. I'd like to use this library with CPPNs that take as their input xyz and output a 3d tensor of reals.
Wondering if you have a bare bones implementation (e.g. fixed architecture) on hand that you are willing to share, and a paper you'd like to be cited if that example were to be adapted for academic research.
Thanks,
Sam
The text was updated successfully, but these errors were encountered:
Hi Sam! Unfortunately, we don't have any CPPN examples right now, but here are some pointers:
pyribs would only work with a fixed architecture, as we assume solutions are a fixed length
To make a neural net work with pyribs, you would need to be able to serialize it to a 1D array, and then deserialize it back to a neural net.
In PyTorch, this can be done by adding methods to an nn.Module like the following:
defserialize(self):
"""Returns 1D array with all parameters in the network."""returnnp.concatenate(
[p.data.cpu().detach().numpy().ravel() forpinself.parameters()])
defdeserialize(self, array):
"""Loads parameters from 1D array."""arr_idx=0forparaminself.model.parameters():
shape=tuple(param.data.shape)
length=np.product(shape)
block=array[arr_idx:arr_idx+length]
iflen(block) !=length:
raiseValueError("Array not long enough!")
block=np.reshape(block, shape)
arr_idx+=lengthparam.data=torch.from_numpy(block).float()
returnself
Finally, we do have this tutorial where we try to train an MNIST network with CMA-ME, but we never finished it (and it uses an outdated pyribs version)
Hi. I'd like to use this library with CPPNs that take as their input xyz and output a 3d tensor of reals.
Wondering if you have a bare bones implementation (e.g. fixed architecture) on hand that you are willing to share, and a paper you'd like to be cited if that example were to be adapted for academic research.
Thanks,
Sam
The text was updated successfully, but these errors were encountered: