from scipy.optimize import fmin_ncg, fmin_tnc
import __main__
import numpy
import pylab
import sys
sys.path.append('/home/antolikjan/topographica/Theano/')
import theano 
from theano import tensor as T
from topo.misc.filepath import normalize_path, application_path
from contrib.modelfit import *
import contrib.dd
import contrib.JanA.dataimport
from contrib.JanA.regression import laplaceBias
from contrib.JanA.visualization import compareModelPerformanceWithRPI, showRFS, visualize2DOF
from contrib.JanA.ofestimation import *

class SimpleContextualModel(object):
	
	def __init__(self,XX,YY,ZZ,of1='Exp',of2='Sqrt'):
	    (self.num_pres,self.kernel_size) = numpy.shape(XX) 	
	    
	    self.Y = theano.shared(YY)
    	    self.X = theano.shared(XX)
	    self.Z = theano.shared(ZZ)
	    self.K = T.dvector('K')
	    self.k1 = self.K[0:self.kernel_size]
	    self.k2 = self.K[self.kernel_size:2*self.kernel_size]
	    self.n1 = self.K[2*self.kernel_size]
	    self.n2 = self.K[2*self.kernel_size+1]