Skip to contents

Internal function to executes a Python script that performs matrix computations using TensorFlow with provided inputs. Retries up to three times if the output file validation fails.

Usage

run_crossprod_solve(
  TF_Environ,
  s1,
  s2,
  postEta,
  path_out,
  denom,
  chunk_size = 1000L,
  threshold_mb = 2000L,
  TF_use_single = TRUE,
  verbose = TRUE,
  solve_chunk_size = 50L,
  solve_max_attempts = 5L,
  LF_Commands_Only = FALSE
)

Arguments

TF_Environ

Character. Path to the Python environment. This argument is required if UseTF is TRUE under Windows. Defaults to NULL.

s1

Character. Path to the input file containing s1 coordinates.

s2

Character Path to the input file containing s2 coordinates.

postEta

Character. Path to the file containing the postEta matrix data.

path_out

Character. Path to rds file where the output results will be saved.

denom

Numeric. The denominator value used in the computation.

chunk_size

Numeric (Optional). Size of chunks to process at a time. Default is 1000.

threshold_mb

Numeric (Optional). Memory threshold (in MB) to manage processing. Default is 2000.

TF_use_single

Logical. Whether to use single precision for the TensorFlow calculations. Defaults to FALSE.

solve_chunk_size

Integer. Chunk size for solve_and_multiply Python function. Default is 50L.

solve_max_attempts

Integer. Maximum number of attempts to run solve and crossprod internal function run_crossprod_solve. Default is 5L.

LF_Commands_Only

Logical. If TRUE, returns the command to run the Python script. Default is FALSE.

Value

Returns the path_out if successful. Returns NULL if all attempts fail.

Details

  • The function checks for the existence of required input files and the Python executable in the specified virtual environment.

  • Executes the Python script using system2.

  • Verifies the output file validity using IASDT.R::CheckData. Retries up to 3 times if the output is invalid.

  • Generates detailed logs if verbose is set to TRUE.

Author

Ahmed El-Gabbas