# Path: models/gru_stacked_simple.py
# class GruStackedSimple(StackedSimple):
#     def __init__(self, review_summary_file, checkpointer, num_layers, attention=False):
#     def get_cell(self):
# 
# Path: helpers/checkpoint.py
# class Checkpointer:
#     def __init__(self, model_nm, cell_nm, attention_type):
#     def steps_per_checkpoint(self, num_steps):
#     def get_checkpoint_steps(self):
#     def steps_per_prediction(self, num_steps):
#     def get_prediction_checkpoint_steps(self):
#     def get_checkpoint_location(self):
#     def get_last_checkpoint(self):
#     def __get_id(self, ckpt_file):
#     def delete_previous_checkpoints(self, num_previous=5):
#     def get_save_address(self):
#     def is_checkpointed(self):
#     def get_data_file_location(self):
#     def get_mapper_file_location(self):
#     def get_mapper_folder_location(self):
#     def get_step_file(self):
#     def is_mapper_checkpointed(self):
#     def is_output_file_present(self):
#     def set_result_location(self, outfile):
#     def get_result_location(self):


import os
import sys
from models import gru_stacked_simple
from helpers import checkpoint
sys.path.append(os.path.abspath(os.path.dirname(__file__) + '/' + '..'))

# Get the review summary file
review_summary_file = 'extracted_data/review_summary.csv'

# Initialize Checkpointer to ensure checkpointing
checkpointer = checkpoint.Checkpointer('stackedSimple', 'gru', 'Attention')
checkpointer.steps_per_checkpoint(1000)
checkpointer.steps_per_prediction(1000)
# Do using GRU cell - without attention mechanism
out_file = 'result/stacked_simple/gru/attention.csv'
checkpointer.set_result_location(out_file)
gru_net = gru_stacked_simple.GruStackedSimple(review_summary_file, checkpointer,attention=True, num_layers=2)
gru_net.set_parameters(train_batch_size=128, test_batch_size=128, memory_dim=128, learning_rate=0.05)
gru_net.begin_session()
gru_net.form_model_graph()
gru_net.fit()

# Path: models/gru_stacked_simple.py
# class GruStackedSimple(StackedSimple):
#     def __init__(self, review_summary_file, checkpointer, num_layers, attention=False):
#     def get_cell(self):
# 
# Path: helpers/checkpoint.py
# class Checkpointer:
#     def __init__(self, model_nm, cell_nm, attention_type):
#     def steps_per_checkpoint(self, num_steps):
#     def get_checkpoint_steps(self):
#     def steps_per_prediction(self, num_steps):
#     def get_prediction_checkpoint_steps(self):
#     def get_checkpoint_location(self):
#     def get_last_checkpoint(self):
#     def __get_id(self, ckpt_file):
#     def delete_previous_checkpoints(self, num_previous=5):
#     def get_save_address(self):
#     def is_checkpointed(self):
#     def get_data_file_location(self):
#     def get_mapper_file_location(self):
#     def get_mapper_folder_location(self):
#     def get_step_file(self):
#     def is_mapper_checkpointed(self):
#     def is_output_file_present(self):
#     def set_result_location(self, outfile):
#     def get_result_location(self):


# Path: train_scripts/train_script_gru_stacked_simple_attn.py
import os
import sys
from models import gru_stacked_simple
from helpers import checkpoint

sys.path.append(os.path.abspath(os.path.dirname(__file__) + '/' + '..'))

# Get the review summary file
review_summary_file = 'extracted_data/review_summary.csv'

# Initialize Checkpointer to ensure checkpointing
checkpointer = checkpoint.Checkpointer('stackedSimple', 'gru', 'Attention')
checkpointer.steps_per_checkpoint(1000)
checkpointer.steps_per_prediction(1000)
# Do using GRU cell - without attention mechanism
out_file = 'result/stacked_simple/gru/attention.csv'
checkpointer.set_result_location(out_file)
gru_net = gru_stacked_simple.GruStackedSimple(review_summary_file, checkpointer,attention=True, num_layers=2)
gru_net.set_parameters(train_batch_size=128, test_batch_size=128, memory_dim=128, learning_rate=0.05)
gru_net.begin_session()
gru_net.form_model_graph()
gru_net.fit()

gru_net.predict()