Skip to content

Commit

Permalink
modified: dsm/__init__.py
Browse files Browse the repository at this point in the history
	modified:   dsm/dsm_api.py
	modified:   dsm/dsm_torch.py
  • Loading branch information
chiragnagpal committed Oct 29, 2020
1 parent fb94ae7 commit 76492bd
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
11 changes: 9 additions & 2 deletions dsm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# along with Deep Survival Machines.
# If not, see <https://www.gnu.org/licenses/>.

r"""
"""
Python package `dsm` provides an API to train the Deep Survival Machines
and associated models for problems in survival analysis. The underlying model
is implemented in `pytorch`.
Expand Down Expand Up @@ -67,7 +67,14 @@
model and allows for learning of representations of the input covariates using
**Recurrent Neural Networks** like **LSTMs, GRUs**. Deep Recurrent Survival
Machines is a natural fit to model problems where there are time dependendent
covariates.
covariates. Examples include situations where we are working with streaming
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.
..warning:: Not Implemented Yet!
Expand Down
7 changes: 4 additions & 3 deletions dsm/dsm_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def fit(self, x, t, e, vsize=0.15,
iters=1, learning_rate=1e-3, batch_size=100,
elbo=True, optimizer="Adam", random_state=100):

r"""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
----------
Expand Down Expand Up @@ -175,7 +175,7 @@ def fit(self, x, t, e, vsize=0.15,


def predict_risk(self, x, t):
r"""Returns the estimated risk of an event occuring before time \( t \)
"""Returns the estimated risk of an event occuring before time \( t \)
\( \widehat{\mathbb{P}}(T\leq t|X) \) for some input data \( x \).
Parameters
Expand All @@ -199,7 +199,7 @@ def predict_risk(self, x, t):


def predict_survival(self, x, t):
r"""Returns the estimated survival probability at time \( t \),
"""Returns the estimated survival probability at time \( t \),
\( \widehat{\mathbb{P}}(T > t|X) \) for some input data \( x \).
Parameters
Expand Down Expand Up @@ -227,6 +227,7 @@ def predict_survival(self, x, t):
"before calling `predict_risk`.")

class DeepRecurrentSurvivalMachines(DeepSurvivalMachines):

__doc__ = "..warning:: Not Implemented"
pass

Expand Down
2 changes: 1 addition & 1 deletion dsm/dsm_torch.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@


def create_representation(inputdim, layers, activation):
r"""Helper function to generate the representation function for DSM.
"""Helper function to generate the representation function for DSM.
Deep Survival Machines learns a representation (\ Phi(X) \) for the input
data. This representation is parameterized using a Non Linear Multilayer
Expand Down

0 comments on commit 76492bd

Please sign in to comment.