I was trying to do a custom loss function but I get the error. This is supposed to be cyclegan for text This is the loss function:
def sloss(ytrue, ypred):
nump = 0
print(nump)
for i in range(len(ypred[0])):
if int(round(ypred[0][i])) != int(ytrue[0][i]):
nump+=1
return(nump)
Model:
models = tf.keras.models.Sequential()
models.add(Dense(100, activation='relu'))
models.add(Dense(100, activation='linear'))
models.add(Dense(100, activation='sigmoid'))
models.compile(loss=sloss, optimizer='adam')
models.fit(sx(1,100 np arr), randes(1,100 np arr), epochs=1)