How solve non Loss problem in tensorflow in regression model

29 views Asked by At

I have a data base with this shape: (1400000, 44)

which the 44th column is output.

all numbers are float and between 0 and 1. I used a Tensorflow like below but the loss function is non and the acc is zero.

# Create network with Keras
import tensorflow as tf
from keras.models import Sequential
from keras.layers import Dense
import numpy as np

dataset=np.loadtxt("Dataset5.txt")


s=dataset.size
tr_size=int( 0.7*s) 

X = dataset[0:tr_size,0:43]

Y = dataset[0:tr_size,43]

# create model
model = Sequential()
model.add(Dense(64, input_dim=43, init='uniform', activation='relu'))
model.add(Dense(16, init='uniform', activation='relu'))
model.add(Dense(4, init='uniform', activation='sigmoid'))
model.add(Dense(1, init='uniform', activation='relu'))
# Compile model

model.compile(loss='mean_squared_error', optimizer='adam', metrics=['accuracy'])
# Fit the model
model.fit(X, Y, epochs=150, batch_size=1000,  verbose=2)
# calculate predictions
predictions = model.predict(X)
0

There are 0 answers