keras-team/autokeras

How to restrict the output of model to be positive

lwq-star opened this issue · 0 comments

I used the model to train data with only positive values, but the predictions yielded negative values. What can I do to make the model's predictions only positive? I don't want to directly change the negative prediction to a positive one. Should I add something to the model?
reg = ak.StructuredDataRegressor(overwrite=True, metrics=[ta.metrics.RSquare(),tf.keras.metrics.RootMeanSquaredError()]) history = reg.fit(x, y, epochs=1000)