liupei101 / tfdeepsurv Goto Github PK
View Code? Open in Web Editor NEWCOX Proportional risk model and survival analysis implemented by tensorflow.
License: MIT License
COX Proportional risk model and survival analysis implemented by tensorflow.
License: MIT License
Hi Liupei,
Thanks for your awsome work TFDeepSurv. But I have problems to restore variables from the saved checkpoint file.
saver = tf.train.import_meta_graph(load_model+'final.ckpt.meta')
saver.restore(self.sess, load_model+'final.ckpt')
all_vars = tf.get_collection(tf.GraphKeys.GLOBAL_VARIABLES)
print(all_vars)
for v in all_vars:
v_ = sess.run(v)
print(v_)
It appears errors. Could you have ideas to fix this? Thanks a lot!
Traceback (most recent call last):
File "c:\users\shuyan\anaconda3\lib\site-packages\tensorflow_core\python\client\session.py", line 1365, in _do_call
return fn(*args)
File "c:\users\shuyan\anaconda3\lib\site-packages\tensorflow_core\python\client\session.py", line 1350, in _run_fn
target_list, run_metadata)
File "c:\users\shuyan\anaconda3\lib\site-packages\tensorflow_core\python\client\session.py", line 1443, in _call_tf_sessionrun
run_metadata)
tensorflow.python.framework.errors_impl.FailedPreconditionError: Attempting to use uninitialized value encoder_layer1/biases
[[{{node encoder_layer1/biases/read}}]]
During handling of the above exception, another exception occurred:
@liupei101 Thank you so much for the package.
Could you please tell is it possible to use TFDeepSurv package on medical images ?
Where can the convolution layers be introduced?
Thank you!
@liupei101 Thank you so much for the package.
Could you please advise is it possible to use GPU support for this TFDeepSurv package?
Thank you!
Hello!When I used hpopt.py to search hyperparameters ,the following error occurred:ValueError: NaNs detected in inputs, please correct or drop. Do you know why?
File "D:/pythonProject1/femaletiaocan.py", line 101, in train_dsl_by_vd
ds.train(train_X, train_y, num_steps=params['num_rounds'], silent=True)
File "D:\Program Files\Python\lib\site-packages\tfdeepsurv\dsl.py", line 238, in train
watch_list['metrics'].append(concordance_index(self.train_data_y.values, -y_hat))
File "D:\Program Files\Python\lib\site-packages\tfdeepsurv\utils.py", line 106, in concordance_index
ci_value = ci(t, y_pred, e)
File "D:\Program Files\Python\lib\site-packages\lifelines\utils\concordance.py", line 91, in concordance_index
event_times, predicted_scores, event_observed = _preprocess_scoring_data(event_times, predicted_scores, event_observed)
File "D:\Program Files\Python\lib\site-packages\lifelines\utils\concordance.py", line 301, in _preprocess_scoring_data
raise ValueError("NaNs detected in inputs, please correct or drop.")
ValueError: NaNs detected in inputs, please correct or drop.
Have you published any related articles? If I use this model, how can I refer to your method?
Hi, is there a way to include other activation functions (ex. selu) for the hyperparameter search? Thank you!
Why The C index has always been 0.5,and the average loss at step remains unchanged?
Hi Liupei101,
This package looks great. Wondering if we cud play/test this package with a new sample data set. If ok, can you please guide thru initial steps to start with - newbie pls..thanks...or wud like to discuss a couple of questions - u may pls advise about the best way to contact/communicate, thanq so much, appreciate ur time/help...
The training set is adjusted according to the proportion of 0.8, and the parameters after Bayesian parameter optimization are not optimal for the whole training set. Do you know how to solve this problem?
In the _create_loss function, the loss_breslow is something divided by Obs. However the variable Obs is the count of events in a batch, which is likely to be 0.
How do you solve this problem?
@liupei101 in the dsl.py you have added this comment "Since style of batch
is not appropriate in survival analysis."
Could you please advise why batch (mini-batch) training is not appropriate in survival analysis? I notice that the DeepSur (https://github.com/jaredleekatzman/DeepSurv ) also does not support the mini-batch training.
Based on my understanding, mini-batch should be suitable for any ML problem as long as we train enough epoch. Feel free to correct me if I misunderstand this.
Thank you so much!
Hyopt tuning - i can't seem to change the numbers of hidden layers to any other of the [6,3,1] - any other turns an error of hidden layers.
also is there any way of tuning this as part of the parameters?
on 6,3,1 - it's thrown away after 16% saying there are NA's? (the dataset has no NA).
Hello,
Thank you for your great packages.
I run hpopt.py but at the end of the process, nothing has been written in JSON output file due to bellow error
Any help would be greatly appreciated
raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type int32 is not JSON serializable`
What are the complete names of these algorithms ("wwe", "kp", "bsl", "Breslow" , "Efron" )?
Hi liupei101,
bysopt
. It works fine and generates a list of hyper parameters in log file (for example: log_hpopt_xxx.json) - similar to the one generated with simulated_data.b) included the best parameters obtained from 1 (refer example parameters in code snippet# 1 below ] to the real data set, and initialized the neural n/w, as per 4.1.3
c) trained the n/w as per 4.1.4 - via model.train and/or model.learn (tried both too), and attempted to evaluate performance and got learning curves - as described in 4.1.4a and 4.1.4b. Up to this point works great with no issues.
However, I have a concern/question on finanl CI value mismatches - final ones on learning curve or from 4.1.5 - are lower than the ones generated in log_hpopt_xxx.json file. [For example, Final CI values thru model.train or model.learn are way lesser than the ones mentioned in code snippet # 1 values; ci_train and ci_valid are supposed to be in the range 0.7745, 0.7485 respectively - but I'm seeing in the range of 0.65 - 0.7 (Ci_train_set) and 0.55- 0.62 (ci_test_set).
Question for you:
Why is it not able to generate the ci values - close to ones obtained in search-space in json file? am i missing anything? One thing, I coudl see is - in hyopt script, the spilit seed = 42; but there is no seeding applied when I ran with real data, as per 4.2.1, using one time split (refer code snippet# 2 below) - so, would that be a cause for total mismatch or lower ci values? Can you thow some light on this and point me to the right direction - if any thing missing...
Hope I explained the issue clearly - if you need more info ro have any questions for me, please let me know. Appreciate your help/suggestions, pls.
Code snippet# 1:
{"params": {"dropout": 1.0, "activation": "tanh", "L2_reg": 0.00027453142563396016, "learning_rate_decay": 1.0, "L1_reg": 0.0008515639202782554, "num_rounds": 1500, "learning_rate": 0.6, "optimizer": "adam"}, "ci_validation": 0.748552011474626, "ci_train": 0.7757347200677045},
Code snippet# 2:
train_X, train_y, test_X, test_y = load_data('full_data.csv', excluded_col=['ID'], surv_col={'e': 'event', 't': 'time'}, split_ratio=0.8)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.