Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix module 'keras.backend' has no attribute 'sum' #51

Merged
merged 2 commits into from
Jan 14, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/ccompass/MOP.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import numpy as np
import pandas as pd
import tensorflow as tf
from keras import ops
from scipy import stats
from sklearn import svm
from sklearn.metrics import (
Expand Down Expand Up @@ -274,7 +275,7 @@ def create_fullprofiles(fract_marker, fract_test):


def sum1_normalization(x):
return x / (K.sum(x, axis=1, keepdims=True) + K.epsilon())
return x / (ops.sum(x, axis=1, keepdims=True) + K.epsilon())


def combine_rounds(data):
Expand Down Expand Up @@ -374,7 +375,7 @@ def build(self, hp):
# units_init = np.shape(y_train_mixed_up)[1]
model.add(
tf.keras.Input(
self.set_shapes[0],
(self.set_shapes[0],),
)
)
# model.add(tf.keras.Input(units_init,))
Expand Down Expand Up @@ -848,7 +849,7 @@ def multi_predictions(
FNN_ens = []
FNN_ens.append(FNN_best)
# FNN_ens[0] = copy.deepcopy(FNN_best)
FNN_best.build(y_train_mixed_up.shape)
# FNN_best.build(y_train_mixed_up.shape)

stringlist = []
FNN_best.summary(print_fn=lambda x: stringlist.append(x))
Expand Down
Loading