Skip to contents

Reads neural network parameters (weights, biases, activation functions) from output files generated by an optimized training process and constructs a complete model object.

Usage

readOutputFiles.optimized(tmpDir, model_type, architecture)

Arguments

tmpDir

Character string specifying the temporary directory path where the model output files are stored.

model_type

Character string describing the type of model.

architecture

Character string describing the neural network architecture.

Value

Returns an object of class ccModel containing:

  • Bias - List of bias matrices for each layer

  • Theta - List of weight matrices for each layer

  • Activation - List of activation functions for each layer

  • Depth - Integer specifying the number of layers

  • Model_type - The input model type

  • Architecture - The input architecture description

Details

This function reads the following files from the specified directory:

  • Activations.csv - Contains activation function names (one per line)

  • Bias{i}.csv - Bias values for layer i (where i = 1, 2, ...)

  • Theta{i}.csv - Weight values for layer i (where i = 1, 2, ...)

The function automatically determines the network depth from the number of activation functions and loads the corresponding parameters for each layer. All CSV files are expected to be comma-separated without row names.

References

Johnson TS, Yu CY, Huang Z, Xu S, Wang T, Dong C, et al. Diagnostic Evidence GAuge of Single cells (DEGAS): a flexible deep transfer learning framework for prioritizing cells in relation to disease. Genome Med. 2022 Feb 1;14(1):11.

Examples

if (FALSE) { # \dontrun{
# Read model files from temporary directory
model <- readOutputFiles.optimized(
  tmpDir = "/path/to/model/files",
  Model_type = "Classification",
  architecture = "12"
)
} # }