def main(): # The tests can't even run if nose isn't available, so might as well give the # user a civilized error message in that case. try: import nose except ImportError: error = """\ ERROR: The IPython test suite requires nose to run. Please install nose on your system first and try again. For information on installing nose, see: http://nose.readthedocs.org/en/latest/ Exiting.""" import sys print(error, file=sys.stderr) else: import theano theano.test()
__author__ = 'rguo12' import theano theano.test()
# # print (str(w.get_value()) + str(b.get_value())) # # Construct Theano expression graph # p_1 = 1 / (1 + T.exp(-T.dot(x, w) - b)) # Probability that target = 1 # prediction = p_1 > 0.5 # The prediction thresholded # xent = -y * T.log(p_1) - (1-y) * T.log(1-p_1) # Cross-entropy loss function # cost = xent.mean() + 0.01 * (w ** 2).sum()# The cost to minimize # gw, gb = T.grad(cost, [w, b]) # Compute the gradient of the cost # # (we shall return to this in a # # following section of this tutorial) # # Compile # train = theano.function( # inputs=[x,y], # outputs=[prediction, xent], # updates=((w, w - 0.1 * gw), (b, b - 0.1 * gb))) # predict = theano.function(inputs=[x], outputs=prediction) # # Train # for i in range(training_steps): # pred, err = train(D[0], D[1]) # print ("Final model:") # print (str(w.get_value()) + str(b.get_value())) # print ("target values for D:"+ D[1]) # print ("prediction on D:"+ predict(D[0])) import theano theano.test() # print (theano.config)