Insults icon indicating copy to clipboard operation
Insults copied to clipboard

Fix the following garbage code

Open thundergolfer opened this issue 8 years ago • 1 comments

from nn_model/util.py

def binarize(x, sz=71):
    return tf.to_float(tf.one_hot(x, sz, on_value=1, off_value=0, axis=-1))


def binarize_outshape(in_shape):
    return in_shape[0], in_shape[1], 71

Who in their right mind would hard code magic numbers like....

thundergolfer avatar Jul 03 '17 08:07 thundergolfer

Turns out these functions actually get passed in as objects to another function, so removing those hard-coded 71 values is not trivial. Still, should be done.

thundergolfer avatar Jul 03 '17 13:07 thundergolfer