Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
Chufan Gao committed Dec 29, 2020
1 parent a69418e commit 427a6d3
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 56 deletions.
2 changes: 1 addition & 1 deletion dsm/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ def _load_mnist():
x = train.data.numpy()
x = np.expand_dims(x, 1).astype(float)
t = train.targets.numpy().astype(float) + 1

e, t = increase_censoring(np.ones(t.shape), t, p=.5)

return x, t, e
Expand Down
7 changes: 4 additions & 3 deletions dsm/dsm_torch.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,14 +391,15 @@ class DeepConvolutionalSurvivalMachinesTorch(nn.Module):
This is an implementation of Deep Convolutional Survival Machines model
in torch. It inherits from `DeepSurvivalMachinesTorch` and replaces the
input representation learning MLP with an simple convnet, the parameters of the
underlying distributions and the forward function which is called whenever
input representation learning MLP with an simple convnet, the parameters of
the underlying distributions and the forward function which is called whenever
data is passed to the module. Each of the parameters are nn.Parameters and
torch automatically keeps track and computes gradients for them.
.. warning::
Not designed to be used directly.
Please use the API inferface `dsm.dsm_api.DeepConvolutionalSurvivalMachines`!!
Please use the API inferface
`dsm.dsm_api.DeepConvolutionalSurvivalMachines`!!
Parameters
----------
Expand Down
2 changes: 1 addition & 1 deletion dsm/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def train_dsm(model,
_reshape_tensor_with_nans(eb),
elbo=elbo,
risk=str(r+1))
#print ("Train Loss:", float(loss))
#print ("Train Loss:", float(loss))
loss.backward()
optimizer.step()
valid_loss = 0
Expand Down
51 changes: 0 additions & 51 deletions examples/conv_example.py

This file was deleted.

0 comments on commit 427a6d3

Please sign in to comment.