Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Nov 13, 2024
1 parent 26131c5 commit c0eda75
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions src/scvi/external/decipher/_components.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from collections.abc import Sequence

import numpy as np
import torch
import torch.nn as nn

Expand Down Expand Up @@ -52,9 +51,7 @@ def __init__(
last_output_end_idx = 0
self.output_slices = []
for dim in self.output_dims:
self.output_slices.append(
slice(last_output_end_idx, last_output_end_idx + dim)
)
self.output_slices.append(slice(last_output_end_idx, last_output_end_idx + dim))
last_output_end_idx += dim

# Create masked layers
Expand All @@ -66,21 +63,15 @@ def __init__(
batch_norms.append(nn.BatchNorm1d(hidden_dims[0]))
for i in range(1, len(hidden_dims)):
layers.append(
torch.nn.Linear(
hidden_dims[i - 1] + deep_context_dim, hidden_dims[i]
)
torch.nn.Linear(hidden_dims[i - 1] + deep_context_dim, hidden_dims[i])
)
batch_norms.append(nn.BatchNorm1d(hidden_dims[i]))

layers.append(
torch.nn.Linear(
hidden_dims[-1] + deep_context_dim, self.output_total_dim
)
torch.nn.Linear(hidden_dims[-1] + deep_context_dim, self.output_total_dim)
)
else:
layers.append(
torch.nn.Linear(input_dim + context_dim, self.output_total_dim)
)
layers.append(torch.nn.Linear(input_dim + context_dim, self.output_total_dim))

self.layers = torch.nn.ModuleList(layers)

Expand Down

0 comments on commit c0eda75

Please sign in to comment.