def init(request): global initalized s = "" if not initalized: control.initialize() initalized = True s = "Initalized." else: s = "Already Done." return HttpResponse(s)
def index(request): global initalized s = "" if not initalized: control.initialize() initalized = True s = "Initalized." else: s = "Already Done." print s return render_to_response("churchill/join.html", {"game_count": "Zero"})
def main(): mnist = input_data.read_data_sets("../resource") X, prob, loss, ops = control.initialize() init = tf.global_variables_initializer() with tf.Session() as sess: init.run() for epoch in range(n_epochs): for iteration in range(mnist.train.num_examples // batch_size): X_batch, y_batch = mnist.train.next_batch(batch_size) for j in range(batch_size): print("Epoch: " + str(epoch) + ", batch: " + str(iteration) + ", iteration: " + str(j)) input = np.reshape(X_batch[j], (1, 784)) sess.run(ops, feed_dict={X: input}) input = np.reshape(X_batch[0], (1, 784)) energy = loss.eval(feed_dict={X: input}) probability = prob.eval(feed_dict={X: input}) print(probability.shape) save_path = saver.save(sess, "./my_model_final.ckpt")
""" This is a small audio/visualization tool. It creates two animated graphs and an audio the_sig. """ import control PARAMS = { "LEN_TRACE_VIS": 256, # How much of trace to show "LEN_TRACE_WIN": 30, # Size of the FFT window "SPEC_MAX_TIME": 50, # Time to show on spectrogram "SPREAD": 20, # Distance between spec lines "LWR_BND": -1, # Bottom of trace graph } assert PARAMS["LEN_TRACE_VIS"] > 0 assert PARAMS["LEN_TRACE_WIN"] > 0 assert PARAMS["SPEC_MAX_TIME"] > 0 assert PARAMS["LEN_TRACE_WIN"] <= PARAMS["LEN_TRACE_VIS"] # Prep animation. control.initialize(PARAMS) # Kickoff. control.run()
""" This is a small audio/visualization tool. It creates two animated graphs and an audio the_sig. """ import control PARAMS = { 'LEN_TRACE_VIS': 256, #How much of trace to show 'LEN_TRACE_WIN': 30, #Size of the FFT window 'SPEC_MAX_TIME': 50, #Time to show on spectrogram 'SPREAD': 20, #Distance between spec lines 'LWR_BND': -1 #Bottom of trace graph } assert PARAMS['LEN_TRACE_VIS'] > 0 assert PARAMS['LEN_TRACE_WIN'] > 0 assert PARAMS['SPEC_MAX_TIME'] > 0 assert PARAMS['LEN_TRACE_WIN'] <= PARAMS['LEN_TRACE_VIS'] #Prep animation. control.initialize(PARAMS) #Kickoff. control.run()