tancik / fourier-feature-networks

Fourier Features Let Networks Learn High Frequency Functions in Low Dimensional Domains
https://people.eecs.berkeley.edu/~bmild/fourfeat/
MIT License
1.27k stars 134 forks source link

3d_MRI.ipynb: Out of memory error -- is there a way to reduce the batch size or similar? #2

Closed sck closed 4 years ago

sck commented 4 years ago

I am trying to run 3d_MRI.ipynb locally but I haven't found any way to adjust the memory usage. There isn't an obvious batch_size variable -- any hints?

Thanks!

pratulsrinivasan commented 4 years ago

Ah yeah sorry the 3D MRI experiments use a lot of GPU memory. The batch_size is actually the total number of voxels (x_train) since you need all the samples in order to take the Fourier transform to compute the loss. One way to reduce memory usage is to just decrease the voxel grid resolution (RES).