Skip to contents

Create a TorchDecon model object with specified architecture.

Usage

CreateTorchDecon(
  n_features,
  n_classes,
  architecture = c("m256", "m512", "m1024", "custom"),
  hidden_units = NULL,
  dropout_rates = NULL,
  device = "auto",
  seed = NULL
)

Arguments

n_features

Integer. Number of input features (genes).

n_classes

Integer. Number of output classes (cell types).

architecture

Character. One of "m256", "m512", "m1024", or "custom". Default is "m256".

hidden_units

Integer vector. Custom hidden layer sizes (only used if architecture = "custom"). Default is NULL.

dropout_rates

Numeric vector. Custom dropout rates (only used if architecture = "custom"). Default is NULL.

device

Character. Device to use ("cpu", "cuda", or "auto"). Default is "auto".

seed

Integer. Random seed for reproducibility. Default is NULL.

Value

A TorchDeconModel object containing the neural network and metadata.

Details

Pre-defined architectures:

  • m256: Hidden units 256-128-64-32, no dropout

  • m512: Hidden units 512-256-128-64, dropout 0/0.3/0.2/0.1

  • m1024: Hidden units 1024-512-256-128, dropout 0/0.6/0.3/0.1

Examples

if (FALSE) { # \dontrun{
# Create a model with m256 architecture
model <- CreateTorchDecon(n_features = 5000, n_classes = 10, architecture = "m256")

# Create a custom architecture
model <- CreateTorchDecon(
  n_features = 5000,
  n_classes = 10,
  architecture = "custom",
  hidden_units = c(512, 256, 128, 64),
  dropout_rates = c(0.1, 0.2, 0.1, 0.1)
)
} # }