import tensorflow as tf
import numpy




@@ -30,11 +30,1108 @@
 t numpy%0A
-%0A
+import os%0Aimport glob%0Aimport pickle%0Aimport random%0Aimport itertools%0Aimport scipy.sparse%0Afrom sklearn.cross_validation import train_test_split%0Aimport h5py%0Aimport math%0Aimport time%0A%0Aimport PROJECT_CONSTANTS as pconst%0A%0A# God-Tier Mr. Game And Watch RNG: https://youtu.be/wOyKt13HO78?t=39s%0ARNG = numpy.random%0A%0Adef floatX(x):%0A    %22%22%22%0A    Casts a number to a numpy float32 value as an array%0A%0A    Params:%0A        x - floating point number to cast%0A%0A    Returns:%0A        x as a NumPy float32 value within a NumPy array%0A    %22%22%22%0A    return numpy.asarray(x, dtype=pconst.FLOAT_TYPE)%0A%0Adef load_data(DIR=pconst.PGN_FILE_DIRECTORY):%0A    %22%22%22%0A    Loads the data from a specified directory containing .hdf5 files obtained%0A    from .pgn files from game_reader.py%0A%0A    Params:%0A        DIR - Directory containing .hdf5 files. PGN_FILE_DIRECTORY (inside%0A              PROJECT_CONSTANTS) by default%0A%0A    Yields:%0A        A generator of read h5py objects%0A    %22%22%22%0A    for fin in glob.glob(DIR + %22/*.hdf5%22):%0A        try:%0A            yield h5py.File(fin, 'r')%0A        except:%0A            print(%22Failed reading file: %25s%22 %25 (fin))
 %0A%0A

Add utility functions for trainer