|
|
|
"""
|
|
|
|
(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
|
|
|
|
from multiprocessing import Queue
|
|
|
|
'context':self.info['context'] ,
|
|
|
|
- Trainer -> pre-processing
|
|
|
|
- Generation -> post processing
|
|
|
|
The specifications of a state space in the configuration file is as such
|
|
|
|
state:{pre:{path,pipeline:[]}, post:{path,pipeline:[]}}
|
|
|
|
"""
|
|
|
|
self._states = None
|
|
|
|
|
|
|
|
if 'state' in self.info :
|
|
|
|
try:
|
|
|
|
_config = self.info ['state']
|
|
|
|
self._states = State.instance(_config)
|
|
|
|
except Exception as e:
|
|
|
|
print (e)
|
|
|
|
pass
|
|
|
|
finally:
|
|
|
|
# __info = (pd.DataFrame(self._states)[['name','path','args']]).to_dict(orient='records')
|
|
|
|
if self._states :
|
|
|
|
__info = {}
|
|
|
|
|
|
|
|
for key in self._states :
|
|
|
|
__info[key] = [{"name":_item['name'],"args":_item['args'],"path":_item['path']} for _item in self._states[key]]
|
|
|
|
self.log(object='state-space',action='load',input=__info)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# print ()
|
|
|
|
_logs = {'action':'status','input':{'pre':self._states['pre']}}
|
|
|
|
if self._encoder is None :
|
|
|
|
end = datetime.now() #.strftime('%Y-%m-%d %H:%M:%S')
|
|
|
|
#
|
|
|
|
|
|
|
|
if _item['type'].upper() in ['DATE','DATETIME','TIMESTAMP'] :
|
|
|
|
_type = None
|
|
|
|
np.random.shuffle(_index)
|
|
|
|
:param batch (default 2k) size of the batch
|