|
@@ -1,6 +1,10 @@ |
|
|
#!/usr/bin/env python3
|
|
|
#!/usr/bin/env python3
|
|
|
|
|
|
|
|
|
from icosagon.data import Data
|
|
|
from icosagon.data import Data
|
|
|
|
|
|
from icosagon.trainprep import TrainValTest, \
|
|
|
|
|
|
prepare_training
|
|
|
|
|
|
from icosagon.model import Model
|
|
|
|
|
|
from icosagon.trainloop import TrainLoop
|
|
|
import os
|
|
|
import os
|
|
|
import pandas as pd
|
|
|
import pandas as pd
|
|
|
from bisect import bisect_left
|
|
|
from bisect import bisect_left
|
|
@@ -88,9 +92,28 @@ def load_data(): |
|
|
print()
|
|
|
print()
|
|
|
print('OK')
|
|
|
print('OK')
|
|
|
|
|
|
|
|
|
|
|
|
return data
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def _wrap(obj, method_name):
|
|
|
|
|
|
orig_fn = getattr(obj, method_name)
|
|
|
|
|
|
def fn(*args, **kwargs):
|
|
|
|
|
|
print(f'{method_name}() :: ENTER')
|
|
|
|
|
|
res = orig_fn(*args, **kwargs)
|
|
|
|
|
|
print(f'{method_name}() :: EXIT')
|
|
|
|
|
|
return res
|
|
|
|
|
|
setattr(obj, method_name, fn)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def main():
|
|
|
def main():
|
|
|
data = load_data()
|
|
|
data = load_data()
|
|
|
|
|
|
prep_d = prepare_training(data, TrainValTest(.8, .1, .1))
|
|
|
|
|
|
_wrap(Model, 'build')
|
|
|
|
|
|
model = Model(prep_d)
|
|
|
|
|
|
_wrap(TrainLoop, 'build')
|
|
|
|
|
|
_wrap(TrainLoop, 'run_epoch')
|
|
|
|
|
|
loop = TrainLoop(model, batch_size=1000000)
|
|
|
|
|
|
loop.run_epoch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
if __name__ == '__main__':
|
|
|