190d9b204a1a4798f0723c8d8d37ac5ac950909e,pycox/models/deephit.py,DeepHitSingle,predict_survival_function,#DeepHitSingle#Any#Any#Any#Any#Any#,34
Before Change
def predict_survival_function(self, input, batch_size=8224, eval_=True, to_cpu=False,
num_workers=0):
Mighht need to set to_cpu to true if too large dataset.
cdf = (self.predict(input, batch_size, False, eval_, False, to_cpu, num_workers)
.softmax(1)
[:, :-1]
.cumsum(1)
.cpu()
.numpy())
return 1 - cdf.transpose()
def make_loss_deephit(alpha, sigma):
After Change
Might need to set to_cpu to true if too large dataset.
pmf = self.predict_pmf(input, batch_size, eval_, to_cpu, num_workers, False)
surv = 1 - pmf.cumsum(0)
if tuplefy(input).type() is np.ndarray:
surv = surv.cpu().numpy()
return surv
def predict_pmf(self, input, batch_size=8224, eval_=True, to_cpu=False, num_workers=0,
numpy=None):
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 7
Instances Project Name: havakv/pycox
Commit Name: 190d9b204a1a4798f0723c8d8d37ac5ac950909e
Time: 2019-05-08
Author: haavard.kvamme@gmail..com
File Name: pycox/models/deephit.py
Class Name: DeepHitSingle
Method Name: predict_survival_function
Project Name: pytorch/fairseq
Commit Name: 1c6679294848f303a361cba7b306b760e299bd9c
Time: 2019-09-30
Author: sarthak_garg@apple.com
File Name: fairseq/sequence_scorer.py
Class Name: SequenceScorer
Method Name: generate