mirror of
https://github.com/wassname/ray.git
synced 2026-08-06 13:31:10 +08:00
Add more print statements to lbfgs app to help debug. (#420)
This commit is contained in:
committed by
Philipp Moritz
parent
987db5e725
commit
1ad663b689
@@ -116,9 +116,11 @@ if __name__ == "__main__":
|
||||
batch_size = 100
|
||||
num_batches = mnist.train.num_examples / batch_size
|
||||
batches = [mnist.train.next_batch(batch_size) for _ in range(num_batches)]
|
||||
print "Putting MNIST in the object store."
|
||||
batch_ids = [(ray.put(xs), ray.put(ys)) for (xs, ys) in batches]
|
||||
|
||||
# Initialize the weights for the network to the vector of all zeros.
|
||||
theta_init = 1e-2 * np.random.normal(size=dim)
|
||||
# Use L-BFGS to minimize the loss function.
|
||||
print "Running L-BFGS."
|
||||
result = scipy.optimize.fmin_l_bfgs_b(full_loss, theta_init, maxiter=10, fprime=full_grad, disp=True)
|
||||
|
||||
Reference in New Issue
Block a user