Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quick doc and script fixes + missing folder #2

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This repository provides a reference implementation for learning NeuralSort-base

## Requirements

The codebase is implemented in Python 3.7. To install the necessary requirements, run the following commands:
The codebase is implemented in Python 3.6. To install the necessary requirements, run the following commands:

```
pip install -r requirements.txt
Expand Down
6 changes: 3 additions & 3 deletions tf/run_median.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ def prnt(*args):
TRAIN_PER_EPOCH = mnist_input.TRAIN_SET_SIZE // (l * M)
VAL_PER_EPOCH = mnist_input.VAL_SET_SIZE // (l * M)
TEST_PER_EPOCH = mnist_input.TEST_SET_SIZE // (l * M)
best_val = float('inf')
best_correct_val = float('inf')
tiebreaker_val = -1


Expand Down Expand Up @@ -272,8 +272,8 @@ def test(epoch, val=False):
if val:
prnt("Validation set: correctly identified %f, mean squared error %f" %
(c_i, l_v))
if l_v < best_val:
best_val = l_v
if l_v < best_correct_val:
best_correct_val = l_v
prnt('Saving...')
save_model(epoch)
else:
Expand Down
8 changes: 4 additions & 4 deletions tf/run_sort.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
losses = tf.reduce_mean(losses, axis=-1)
loss = tf.reduce_mean(losses)

if method == 'sinkhorn':
elif method == 'sinkhorn':
representations = multi_mnist_cnn.deepnn(l, X, n)
pre_sinkhorn = tf.reshape(representations, [M, n, n])
P_hat = sinkhorn_operator(pre_sinkhorn, temp=temperature)
Expand All @@ -84,7 +84,7 @@
losses = tf.reduce_mean(losses, axis=-1)
loss = tf.reduce_mean(losses)

if method == 'gumbel_sinkhorn':
elif method == 'gumbel_sinkhorn':
representations = multi_mnist_cnn.deepnn(l, X, n)
pre_sinkhorn = tf.reshape(representations, [M, n, n])
P_hat = sinkhorn_operator(pre_sinkhorn, temp=temperature)
Expand All @@ -102,7 +102,7 @@
losses = tf.reshape(losses, [-1])
loss = tf.reduce_mean(losses)

if method == 'deterministic_neuralsort':
elif method == 'deterministic_neuralsort':
scores = multi_mnist_cnn.deepnn(l, X, 1)
scores = tf.reshape(scores, [M, n, 1])
P_hat = util.neuralsort(scores, temperature)
Expand All @@ -112,7 +112,7 @@
losses = tf.reduce_mean(losses, axis=-1)
loss = tf.reduce_mean(losses)

if method == 'stochastic_neuralsort':
elif method == 'stochastic_neuralsort':
scores = multi_mnist_cnn.deepnn(l, X, 1)
scores = tf.reshape(scores, [M, n, 1])
P_hat = util.neuralsort(scores, temperature)
Expand Down