# Path: utils/ops.py
# def multi_filter_conv_block(input, n_filters, reuse=False,
#                             dropout_keep_prob=0.5, activation='relu',
#                             padding='same', name='mfcb'):
# def lstm_block(input, hidden_units=128, dropout=0.5, reuse=False, layers=1,
#                            dynamic=True, return_seq=False, bidirectional=False):
# def embedding_layer(metadata_path=None, embedding_weights=None,
#                     name='W_embedding', trainable=True, vocab_size=None,
#                     embedding_shape=300):
# def get_regularizer(beta=0.001):
# def get_optimizer(name='adam'):
#     W = None
#         W = tf.Variable(w2v_init, trainable=trainable, name=name)
#         W = tf.get_variable(name, [vocab_size, embedding_shape],
#                         trainable=trainable)
# 
# Path: utils/losses.py
# def mean_squared_error(ground_truth, predictions):
# def categorical_cross_entropy(ground_truth, predictions):
# 
# Path: utils/distances.py
# def exponential(vec_1, vec_2):


import os
import pickle
import datetime
import tensorflow as tf
from utils import ops
from utils import losses
from utils import distances
from scipy.stats import pearsonr
from sklearn.metrics import mean_squared_error
from tflearn.layers.core import fully_connected
from tensorflow.contrib.tensorboard.plugins import projector
        self.sentiment = tf.placeholder(tf.float32, [None],
                                            name="input_sentiment")

    def create_scalar_summary(self, sess):
        # Summaries for loss and accuracy
        self.loss_summary = tf.summary.scalar("loss", self.loss)
        self.pearson_summary = tf.summary.scalar("pco", self.pco)
        self.mse_summary = tf.summary.scalar("mse", self.mse)

        # Train Summaries
        self.train_summary_op = tf.summary.merge([self.loss_summary,
                                                  self.pearson_summary,
                                                  self.mse_summary])

        self.train_summary_writer = tf.summary.FileWriter(self.checkpoint_dir,
                                                     sess.graph)
        projector.visualize_embeddings(self.train_summary_writer,
                                       self.config)

        # Dev summaries
        self.dev_summary_op = tf.summary.merge([self.loss_summary,
                                                self.pearson_summary,
                                                self.mse_summary])

        self.dev_summary_writer = tf.summary.FileWriter(self.dev_summary_dir,
                                                   sess.graph)

    def build_model(self, metadata_path=None, embedding_weights=None):

        with tf.name_scope("embedding"):

# Path: utils/ops.py
# def multi_filter_conv_block(input, n_filters, reuse=False,
#                             dropout_keep_prob=0.5, activation='relu',
#                             padding='same', name='mfcb'):
# def lstm_block(input, hidden_units=128, dropout=0.5, reuse=False, layers=1,
#                            dynamic=True, return_seq=False, bidirectional=False):
# def embedding_layer(metadata_path=None, embedding_weights=None,
#                     name='W_embedding', trainable=True, vocab_size=None,
#                     embedding_shape=300):
# def get_regularizer(beta=0.001):
# def get_optimizer(name='adam'):
#     W = None
#         W = tf.Variable(w2v_init, trainable=trainable, name=name)
#         W = tf.get_variable(name, [vocab_size, embedding_shape],
#                         trainable=trainable)
# 
# Path: utils/losses.py
# def mean_squared_error(ground_truth, predictions):
# def categorical_cross_entropy(ground_truth, predictions):
# 
# Path: utils/distances.py
# def exponential(vec_1, vec_2):


# Path: models/sentence_sentiment_regressor.py
import os
import pickle
import datetime
import tensorflow as tf
from utils import ops
from utils import losses
from utils import distances
from scipy.stats import pearsonr
from sklearn.metrics import mean_squared_error
from tflearn.layers.core import fully_connected
from tensorflow.contrib.tensorboard.plugins import projector

        self.sentiment = tf.placeholder(tf.float32, [None],
                                            name="input_sentiment")

    def create_scalar_summary(self, sess):
        # Summaries for loss and accuracy
        self.loss_summary = tf.summary.scalar("loss", self.loss)
        self.pearson_summary = tf.summary.scalar("pco", self.pco)
        self.mse_summary = tf.summary.scalar("mse", self.mse)

        # Train Summaries
        self.train_summary_op = tf.summary.merge([self.loss_summary,
                                                  self.pearson_summary,
                                                  self.mse_summary])

        self.train_summary_writer = tf.summary.FileWriter(self.checkpoint_dir,
                                                     sess.graph)
        projector.visualize_embeddings(self.train_summary_writer,
                                       self.config)

        # Dev summaries
        self.dev_summary_op = tf.summary.merge([self.loss_summary,
                                                self.pearson_summary,
                                                self.mse_summary])

        self.dev_summary_writer = tf.summary.FileWriter(self.dev_summary_dir,
                                                   sess.graph)

    def build_model(self, metadata_path=None, embedding_weights=None):

        with tf.name_scope("embedding"):

            self.embedding_weights, self.config = ops.embedding_layer(