|
|
|
"""
|
|
|
|
(c) 2019 Data Maker, hiplab.mc.vanderbilt.edu
|
|
|
|
version 1.0.0
|
|
|
|
|
|
|
|
This package serves as a proxy to the overall usage of the framework.
|
|
|
|
This package is designed to generate synthetic data from a dataset from an original dataset using deep learning techniques
|
|
|
|
|
|
|
|
@TODO:
|
|
|
|
- Make configurable GPU, EPOCHS
|
|
|
|
"""
|
|
|
|
import pandas as pd
|
|
|
|
import numpy as np
|
|
|
|
|
|
|
|
self._df = _args['data'] if 'data' in _args else None
|
|
|
|
return [] #{'name':self._df.dtypes.index.tolist()[i],'type':self._df.dtypes.astype(str).tolist()[i]}for i in range(self._df.dtypes.shape[0])]
|
|
|
|
gTrain = gan.Train(**_args)
|
|
|
|
gTrain.apply()
|
|
|
|
|
|
|
|
writer = transport.factory.instance(provider='file',context='write',path=os.sep.join([gTrain.out_dir,'map.json']))
|
|
|
|
writer.write(self._encoder._map,overwrite=True)
|
|
|
|
writer.close()
|
|
|
|
|
|
|
|
#
|
|
|
|
# @TODO: At this point we need to generate another some other objects
|
|
|
|
#
|
|
|
|
_args = {"network_args":self.network_args,"store":self.store,"info":self.info,"candidates":self.candidates,"data":self._df}
|
|
|
|
if self.gpu :
|
|
|
|
_args['gpu'] = self.gpu
|
|
|
|
g = Generator(**_args)
|
|
|
|
# g.run()
|
|
|
|
if os.path.exists(filename):
|
|
|
|
return None
|
|
|
|
|
|
|
|
#
|
|
|
|
years = _df[iname]
|
|
|
|
super().__init__(**_args)
|
|
|
|
:param gpu (optional) index of the gpu to be used if using one
|