pycox
pycox copied to clipboard
Model reset parameters
Hi,
I was working on cross validation/ splitting data using different seed points and then train a PyCOX model before averaging the result.
``for seed in SEEDS:
data, target = X1,Z1
X_train1,X_test,Z_train1,Z_test = train_test_split(data, target, test_size=0.25, random_state=seed)
X_train,X_val,Z_train,Z_val = train_test_split(X_train1,Z_train1, test_size=0.25, random_state=seed)
there are some steps here and I posted the required sections.
log = model.fit(X_train, y_train, batch_size, epochs, callbacks,verbose, val_data=val, val_batch_size=batch_size)
##added the following to reset the parameters
for layer in model.children(): if hasattr(layer, 'reset_parameters'): layer.reset_parameters()
For the first fold/split the result of c-index is always low and then after couple of SEEDS the performance kept growing up. Hence, i believe the training model was not re-initialized after training one fold.
Does anyone know how to fix this issue and reset/re-initialize model for every fold.
Thank you in advance.