TaijaParallel

Documentation for TaijaParallel.

TaijaBase.parallelize — Method
TaijaBase.parallelize(
    parallelizer::ThreadsParallelizer,
    f::typeof(CounterfactualExplanations.Evaluation.evaluate),
    args...;
    kwargs...,
)

Parallelizes the evaluation of f using Threads.@threads. This function is used to evaluate counterfactual explanations.

source
TaijaBase.parallelize — Method
TaijaBase.parallelize(
    parallelizer::ThreadsParallelizer,
    f::typeof(CounterfactualExplanations.generate_counterfactual),
    args...;
    kwargs...,
)

Parallelizes the evaluation of f using Threads.@threads. This function is used to generate counterfactual explanations.

source
TaijaParallel.chunk_obs — Method
chunk_obs(obs::AbstractVector, n_each::Integer, n_groups::Integer)

Split the vector of observations obs into chunks such that each chunk has n_each observations for each available CPU core (i.e. n_groups).

source
TaijaParallel.load_with_retry — Method
load_with_retry(filepath; max_attempts=5, delay=1.0)

Load a file using Serialization.deserialize, retrying up to max_attempts times with exponential backoff.

source
TaijaParallel.split_count — Method
split_count(N::Integer, n::Integer)

Return a vector of n integers which are approximately equally sized and sum to N. Lifted from https://juliaparallel.org/MPI.jl/v0.20/examples/06-scatterv/.

source
TaijaParallel.@with_parallelizer — Macro
@with_parallelizer(parallelizer, expr)

This macro can be used to parallelize a function call or block of code. The macro will check that the function is parallelizable and then call parallelize with the supplied parallelizer and expr.

source