-3
exData = pd.read_csv('AP11.csv',delimiter=';',float_precision=None)
pd.set_option('display.max_colwidth', None )

x = exData.loc[:,['A','B']]
y = exData.loc[:,['C']]

    
x=x.astype('int64')
y=y.astype('int64')



opt = Adam(lr=0.001, decay=1e-6)
model = keras.Sequential([
keras.layers.Dense(2, input_dim=2, activation=keras.activations.sigmoid ),
keras.layers.Dense(1, activation=keras.activations.relu ),
])

model.compile(optimizer=opt, loss="categorical_crossentropy", metrics=model.compile(optimizer=opt, loss="categorical_crossentropy", metrics=['accuracy']))
model.fit(x,y, batch_size=64, epochs=100)

Hello, I want to feed my data to keras as int64 and i want keras to process it as int64 and outputs it as int64. i don't want any float64 to be involved in the process. float64 is not precise at all for my application. i think you might notice that my code is not so good because i didn't program machine learning before so please do correct me to improve my code if needed.

Dia Eid
  • 35
  • 7

1 Answers1

0

Dense layer works with floats only. The only way is to create custom layer from scratch. I don't think it is possible to back propagate gradients efficiently with int64 weights because of the small difference between min and max values.

Andrey
  • 5,932
  • 3
  • 17
  • 35