Skip to content

Commit

Permalink
Fixed bug in redshifting while training.
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-muthukrishna committed Jul 22, 2018
1 parent d273d75 commit c325b2a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions dash/create_and_save_all_data_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
f.write("Redshift: Zero\n")
f.write("Redshift Range: {} to {}\n".format(minZ, maxZ))
f.write("Num of Redshifts: {}\n".format(numOfRedshifts))
f.write("Redshift During Training: {}\n".format(redshiftDuringTraining))
f.write("Fraction of Training Set Used: {}\n".format(trainFraction))
f.write("Training Amount: 50 x {}\n".format(numTrainBatches))
f.write("Changed wavelength range to 3500 to 10000A\n")
Expand Down
4 changes: 2 additions & 2 deletions dash/deep_learning_multilayer.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ def train_model(dataDirName, overwrite=False, numTrainBatches=500000, minZ=0, ma
# Redshift arrays
if redshifting is True:
redshifts = np.random.uniform(low=minZ, high=maxZ, size=len(batch_xs))
for i, z in enumerate(redshifts):
batch_xs[i] = redshift_binned_spectrum(batch_xs[i], z, nIndexes, dwlog, w0, w1, nw, outerVal=0.5)
for j, z in enumerate(redshifts):
batch_xs[j] = redshift_binned_spectrum(batch_xs[j], z, nIndexes, dwlog, w0, w1, nw, outerVal=0.5)

train_step.run(feed_dict={x: batch_xs, y_: batch_ys, keep_prob: 0.5})
if i % 100 == 0:
Expand Down

0 comments on commit c325b2a

Please sign in to comment.