Move DSSIMObjective to submodule (#93)

* Move DSSIMObjective to submodule

* fix losses/dssim_test.py
This commit is contained in:
Ben
2017-06-07 23:47:39 -04:00
committed by Michael Oliver
parent 3ebf304737
commit ec8010077c
3 changed files with 4 additions and 4 deletions
+1
View File
@@ -0,0 +1 @@
from .dssim import DSSIMObjective
@@ -5,9 +5,8 @@ from keras.layers import Conv2D
from keras.models import Sequential
from keras.optimizers import Adam
from keras_contrib import losses
from keras.losses import sparse_categorical_crossentropy
from keras import backend as K
from keras_contrib import backend as KC
from keras_contrib.losses import DSSIMObjective
allobj = []
@@ -32,12 +31,12 @@ def test_objective_shapes_2d():
def test_cce_one_hot():
y_a = K.variable(np.random.randint(0, 7, (5, 6)))
y_b = K.variable(np.random.random((5, 6, 7)))
objective_output = losses.sparse_categorical_crossentropy(y_a, y_b)
objective_output = sparse_categorical_crossentropy(y_a, y_b)
assert K.eval(objective_output).shape == (5, 6)
y_a = K.variable(np.random.randint(0, 7, (6,)))
y_b = K.variable(np.random.random((6, 7)))
assert K.eval(losses.sparse_categorical_crossentropy(y_a, y_b)).shape == (6,)
assert K.eval(sparse_categorical_crossentropy(y_a, y_b)).shape == (6,)
def test_DSSIM_channels_last():