Used to check gradient estimation through slope approximation.

def grad(self, params, epsilon=0.0001):
        """Used to check gradient estimation through slope approximation."""
        grad = []
        for x in range(len(params)):
            temp = np.copy(params)
            temp[x] += epsilon
            temp2 = np.copy(params)
            temp2[x] -= epsilon
            grad.append((self.__cost_function(temp)-self.__cost_function(temp2))/(2*epsilon))
        return np.array(grad)