Tensorflow implementation of a DCGAN I wrote for a school project. The implementation uses a ImageLoader which is responsible for feeding the model with learning data during learning and can be repurposed for differend kinds od data. Here I used it for the CelebA data set and for the speech commands dataset where the audio is transformed into an SFTF image representation.
The ImageLoader
is originally implemented to give cropped images of the CelebA dataset, but you can write a subclass that can essentially work with any kind of data, as long as the new subclass is going to return data that is in a 3D shape.
To repurpose it, create a new class with the ImageLoader
parrent. The main method that probably would need to get overridden is _get_image()
, which transforms the original data into a desired 3D shape.
For an example see the SCC
class, which is an example of an ImageLoader
subclass that reads audio data and constructs a polar form STFT which can be modeled by the DCGAN.
- Python 3.X
- Tensorflow
- Numpy/Scipy
- Matplotlib
Learning was done on a laptop with a Nvidia GTX-860M card and went on only for 14 epochs.
Since the dataset was smaller I could achieve a lager number of epochs, 87 in total.