From dd0e9350d85ae1d6df8b457cde8fcd3ec287f716 Mon Sep 17 00:00:00 2001 From: Chirag Nagpal Date: Sun, 1 Nov 2020 14:52:04 -0500 Subject: [PATCH] modified: docs/dsm_api.html modified: docs/dsm_torch.html modified: docs/index.html --- docs/dsm_api.html | 156 +++++++++++++++++++++++++++++++++++--------- docs/dsm_torch.html | 34 ---------- docs/index.html | 26 ++++++-- 3 files changed, 147 insertions(+), 69 deletions(-) diff --git a/docs/dsm_api.html b/docs/dsm_api.html index a73e03d..ecfd9f6 100644 --- a/docs/dsm_api.html +++ b/docs/dsm_api.html @@ -76,16 +76,16 @@

Example

>>> model = DeepSurvivalMachines() >>> model.fit(x, t, e) -

Ancestors

-

Methods

def fit(self, x, t, e, vsize=0.15, iters=1, learning_rate=0.001, batch_size=100, elbo=True, optimizer='Adam', random_state=100)
+

+Inherited from: +DSMBase.fit +

This method is used to train an instance of the DSM model.

Parameters

@@ -123,8 +123,21 @@

Parameters

Inherited from: DSMBase.predict_risk

-

Returns the estimated risk of an event occuring before time t - \widehat{\mathbb{P}}(T\leq t|X) for some input data x

+

Returns the estimated risk of an event occuring before time t + \widehat{\mathbb{P}}(T\leq t|X) for some input data x .

+

Parameters

+
+
x : np.ndarray
+
A numpy array of the input features, x .
+
t : list or float
+
a list or float of the times at which survival probability is +to be computed
+
+

Returns

+
+
np.array
+
numpy array of the risks at each time in t.
+
def predict_survival(self, x, t) @@ -134,8 +147,21 @@

Parameters

Inherited from: DSMBase.predict_survival

-

Returns the estimated survival probability at time t , - \widehat{\mathbb{P}}(T > t|X) for some input data x

+

Returns the estimated survival probability at time t , + \widehat{\mathbb{P}}(T > t|X) for some input data x .

+

Parameters

+
+
x : np.ndarray
+
A numpy array of the input features, x .
+
t : list or float
+
a list or float of the times at which survival probability is +to be computed
+
+

Returns

+
+
np.array
+
numpy array of the survival probabilites at each time in t.
+
@@ -146,20 +172,16 @@

Parameters

The Deep Recurrent Survival Machines model to handle data with time-dependent covariates.

-

Ancestors

-
    -
  • dsm.dsm_api.DSMBase
  • -
-

Subclasses

-

Methods

def fit(self, x, t, e, vsize=0.15, iters=1, learning_rate=0.001, batch_size=100, elbo=True, optimizer='Adam', random_state=100)
+

+Inherited from: +DSMBase.fit +

This method is used to train an instance of the DSM model.

Parameters

@@ -197,8 +219,21 @@

Parameters

Inherited from: DSMBase.predict_risk

-

Returns the estimated risk of an event occuring before time t - \widehat{\mathbb{P}}(T\leq t|X) for some input data x

+

Returns the estimated risk of an event occuring before time t + \widehat{\mathbb{P}}(T\leq t|X) for some input data x .

+

Parameters

+
+
x : np.ndarray
+
A numpy array of the input features, x .
+
t : list or float
+
a list or float of the times at which survival probability is +to be computed
+
+

Returns

+
+
np.array
+
numpy array of the risks at each time in t.
+
def predict_survival(self, x, t) @@ -208,8 +243,21 @@

Parameters

Inherited from: DSMBase.predict_survival

-

Returns the estimated survival probability at time t , - \widehat{\mathbb{P}}(T > t|X) for some input data x

+

Returns the estimated survival probability at time t , + \widehat{\mathbb{P}}(T > t|X) for some input data x .

+

Parameters

+
+
x : np.ndarray
+
A numpy array of the input features, x .
+
t : list or float
+
a list or float of the times at which survival probability is +to be computed
+
+

Returns

+
+
np.array
+
numpy array of the survival probabilites at each time in t.
+
@@ -221,11 +269,6 @@

Parameters

Warning: Not Implemented

-

Ancestors

-

Methods

@@ -236,7 +279,34 @@

Methods

Inherited from: DeepRecurrentSurvivalMachines.fit

-

This method is used to train an instance of the DSM model …

+

This method is used to train an instance of the DSM model.

+

Parameters

+
+
x : np.ndarray
+
A numpy array of the input features, x .
+
t : np.ndarray
+
A numpy array of the event/censoring times, t .
+
e : np.ndarray
+
A numpy array of the event/censoring indicators, \delta . + \delta = 1 means the event took place.
+
vsize : float
+
Amount of data to set aside as the validation set.
+
iters : int
+
The maximum number of training iterations on the training dataset.
+
learning_rate : float
+
The learning rate for the Adam optimizer.
+
batch_size : int
+
learning is performed on mini-batches of input data. this parameter +specifies the size of each mini-batch.
+
elbo : bool
+
Whether to use the Evidence Lower Bound for optimization. +Default is True.
+
optimizer : str
+
The choice of the gradient based optimization method. One of +'Adam', 'RMSProp' or 'SGD'.
+
random_state : float
+
random seed that determines how the validation set is chosen.
+
def predict_risk(self, x, t) @@ -246,8 +316,21 @@

Methods

Inherited from: DeepRecurrentSurvivalMachines.predict_risk

-

Returns the estimated risk of an event occuring before time t - \widehat{\mathbb{P}}(T\leq t|X) for some input data x

+

Returns the estimated risk of an event occuring before time t + \widehat{\mathbb{P}}(T\leq t|X) for some input data x .

+

Parameters

+
+
x : np.ndarray
+
A numpy array of the input features, x .
+
t : list or float
+
a list or float of the times at which survival probability is +to be computed
+
+

Returns

+
+
np.array
+
numpy array of the risks at each time in t.
+
def predict_survival(self, x, t) @@ -257,8 +340,21 @@

Methods

Inherited from: DeepRecurrentSurvivalMachines.predict_survival

-

Returns the estimated survival probability at time t , - \widehat{\mathbb{P}}(T > t|X) for some input data x

+

Returns the estimated survival probability at time t , + \widehat{\mathbb{P}}(T > t|X) for some input data x .

+

Parameters

+
+
x : np.ndarray
+
A numpy array of the input features, x .
+
t : list or float
+
a list or float of the times at which survival probability is +to be computed
+
+

Returns

+
+
np.array
+
numpy array of the survival probabilites at each time in t.
+
diff --git a/docs/dsm_torch.html b/docs/dsm_torch.html index 238ac0e..5133bf4 100644 --- a/docs/dsm_torch.html +++ b/docs/dsm_torch.html @@ -112,21 +112,6 @@

Parameters

Default is 1.

Initializes internal Module state, shared by both nn.Module and ScriptModule.

-

Ancestors

-
    -
  • torch.nn.modules.module.Module
  • -
-

Class variables

-
-
var dump_patches : bool
-
-
-
-
var training : bool
-
-
-
-

Methods

@@ -189,21 +174,6 @@

Parameters

Default is 1.

Initializes internal Module state, shared by both nn.Module and ScriptModule.

-

Ancestors

-
    -
  • torch.nn.modules.module.Module
  • -
-

Class variables

-
-
var dump_patches : bool
-
-
-
-
var training : bool
-
-
-
-

Methods

@@ -252,8 +222,6 @@

  • forward
  • get_shape_scale
  • -
  • dump_patches
  • -
  • training
  • @@ -261,8 +229,6 @@

  • forward
  • get_shape_scale
  • -
  • dump_patches
  • -
  • training
  • diff --git a/docs/index.html b/docs/index.html index 8e7ef37..f3f87b0 100644 --- a/docs/index.html +++ b/docs/index.html @@ -63,9 +63,10 @@

    Deep Recurrent Survival Machines

    data like vital signs, degradation monitoring signals in predictive maintainance. DRSM allows the learnt representations at each time step to involve historical context from previous time steps. DRSM implementation in -dsm is carried out through an easy to use API that accepts lists of data -streams and corresponding failure times. The module automatically takes care of -appropriate batching and padding of variable length sequences.

    +dsm is carried out through an easy to use API, +DeepRecurrentSurvivalMachines that accepts lists of data streams and +corresponding failure times. The module automatically takes care of appropriate +batching and padding of variable length sequences.

    Warning: Not Implemented Yet!

    @@ -145,11 +146,26 @@

    Sub-modules

    dsm.dsm_torch
    -

    Torch model definitons for the Deep Survival Machines model …

    +

    Torch model definitons for the Deep Survival Machines model

    +

    This includes definitons for the Torch Deep Survival Machines module. +The main interface is the DeepSurvivalMachines class which inherits +from torch.nn.Module.

    +

    Note: NOT DESIGNED TO BE CALLED DIRECTLY!!!

    dsm.losses
    -

    Loss function definitions for the Deep Survival Machines model …

    +

    Loss function definitions for the Deep Survival Machines model

    +

    In this module we define the various losses for the censored and uncensored +instances of data corresponding to Weibull and LogNormal distributions. +These losses are optimized when training DSM.

    +
    +

    TODO

    +

    Use torch.distributions

    +
    +
    +

    Warning

    +

    NOT DESIGNED TO BE CALLED DIRECTLY!!!

    +
    dsm.utilities