JJN123 / Fall-Detection

Non-invasive Fall Detection with Keras and Tensorflow
148 stars 48 forks source link

where is the loss fuction #9

Closed xwr96 closed 3 years ago

xwr96 commented 3 years ago

hi! I can not found the loss fuction in your code,I only see this autoencoder.compile(optimizer='adadelta', loss='mean_squared_error'). So if I want to change the loss fuction,what should I do? Or where the loss fuction is? thanks!

shehrozskhan commented 3 years ago

As the code shows, the loss is "mean squared error", which is the mean of squared difference between input and output. If you want to write your own loss function, please follow KERAS documentation on "Creating custom losses" here --> https://keras.io/api/losses/.

xwr96 commented 3 years ago

but as the paper said,the loss formula is as follow: Screenshot from 2021-06-15 21-56-32 I want to know where the code is?

shehrozskhan commented 3 years ago

This is not the formula for loss, rather it is to calculate the anomaly score. You will want to look into util.py and the following functions below. def make_cross_window_matrix(scores): def agg_window(RE, agg_type): def gather_auc_avg_per_tol(inwin_mean, inwin_std, labels, win_len = 8):