Utils
LogicCircuits.Utils — ModuleModule with general utilities and missing standard library features that could be useful in any Julia project
LogicCircuits.Utils.AbstractBitVector — ConstantRetro-fitted super type of all bit vectors
LogicCircuits.Utils.CuBitVector — TypeCustom CUDA version of BitVector (lacking lots of functionality, just a container for now).
LogicCircuits.Utils.Lit — TypeLiterals are represented as 32-bit signed integers. Positive literals are positive integers identical to their variable. Negative literals are their negations. Integer 0 should not be used to represent literals.
LogicCircuits.Utils.Var — TypeVariables are represented as 32-bit unsigned integers
Base.eltype — MethodFind a type that can capture all column values
Base.isdisjoint — MethodAre the given sets disjoint (no shared elements)?
LogExpFunctions.logsumexp — MethodMarginalize out dimensions dims from log-probability tensor
LogicCircuits.Utils.always — MethodAn array of 100% probabilities for the given element type
LogicCircuits.Utils.bagging_dataset — MethodReturns an array of DataFrames where each DataFrame is randomly sampled from the original dataset data
LogicCircuits.Utils.batch — FunctionCreate mini-batches
LogicCircuits.Utils.batch_size — MethodBatch size of the dataset
LogicCircuits.Utils.bits_per_pixel — MethodNormalize the given log-likelihood as bits per pixel in data
LogicCircuits.Utils.chunks — MethodRetrieve chunks of bit vector
LogicCircuits.Utils.eachcol_unweighted — MethodIterate over columns, excluding the sample weight column
LogicCircuits.Utils.example — MethodGet the ith example
LogicCircuits.Utils.feature_values — MethodGet the ith feature values
LogicCircuits.Utils.fully_factorized_log_likelihood — MethodComputer the per-example log-likelihood of a fully factorized ML model on Bool data
LogicCircuits.Utils.get_bit — MethodRetrieve the jth bit from a BitVector chunk
LogicCircuits.Utils.get_weights — MethodGet the weights from a weighted dataset.
LogicCircuits.Utils.impute — MethodReturn a copy of Imputed values of X (potentially statistics from another DataFrame)
For example, to impute using same DataFrame:
impute(X; method=:median)If you want to use another DataFrame to provide imputation statistics:
impute(test_x, train_x; method=:mean)Supported methods are :median, :mean, :one, :zero
LogicCircuits.Utils.init_array — MethodAn array of undetermined values (fast) for the given element type
LogicCircuits.Utils.isbatched — MethodIs the dataset batched?
LogicCircuits.Utils.isbinarydata — MethodIs the dataset binary?
LogicCircuits.Utils.iscomplete — MethodIs the data complete (no missing values)?
LogicCircuits.Utils.iscomplete_col — MethodIs the data column complete (no missing values)?
LogicCircuits.Utils.isfpdata — MethodIs the dataset consisting of floating point data?
LogicCircuits.Utils.isgpu — MethodCheck whether data resides on the GPU
LogicCircuits.Utils.issomething — MethodIs the argument not nothing?
LogicCircuits.Utils.isweighted — MethodIs the dataset weighted?
LogicCircuits.Utils.lit2var — MethodConvert a literal its variable, removing the sign of the literal
LogicCircuits.Utils.ll_per_example — MethodNormalize the given log-likelihood by the number of examples in data
LogicCircuits.Utils.make_missing_mcar — Methodmake_missing_mcar(d::DataFrame; keep_prob::Float64=0.8)Returns a copy of dataframe with making some features missing as MCAR, with keep_prob as probability of keeping each feature.
LogicCircuits.Utils.marginal_prob — MethodCompute the marginal prob of each feature in a binary dataset.
LogicCircuits.Utils.never — MethodAn array of 0% probabilities for the given element type
LogicCircuits.Utils.noop — MethodFunction that does nothing
LogicCircuits.Utils.num_chunks — MethodFor binary complete data, how many UInt64 bit strings are needed to store one feature?
LogicCircuits.Utils.num_examples — Methodnum_examples(df::DataFrame)Number of examples in data
LogicCircuits.Utils.num_features — Methodnum_features(df::DataFrame)Number of features in the data
LogicCircuits.Utils.num_variables — MethodNumber of variables in the data structure
LogicCircuits.Utils.order_asc — MethodOrder the arguments in a tuple in ascending order
LogicCircuits.Utils.pushrand! — MethodPush element into random position in vectorv
LogicCircuits.Utils.random_sample — FunctionRandomly draw samples from the dataset with replacement
LogicCircuits.Utils.same_device — MethodEnsure that x resides on the same device as data
LogicCircuits.Utils.shuffle_examples — Methodshuffle_examples(df::DataFrame)Shuffle the examples in the data
LogicCircuits.Utils.similar! — MethodReuse a given array if it has the right type and size, otherwise make a new one
LogicCircuits.Utils.soften — FunctionTurn binary data into floating point data close to 0 and 1.
LogicCircuits.Utils.split_sample_weights — MethodSplit a weighted dataset into unweighted dataset and its corresponding weights.
LogicCircuits.Utils.subseteq_fast — MethodReplacement for BitSet.⊆ that does not allocate a new BitSet
LogicCircuits.Utils.threshold — MethodThreshold a numeric dataset making it binary
LogicCircuits.Utils.to_cpu — MethodMove data to the CPU
LogicCircuits.Utils.to_gpu — MethodMove data to the GPU
LogicCircuits.Utils.uniform — MethodAn array of uniform probabilities
LogicCircuits.Utils.var2lit — MethodConvert a variable to the corresponding positive literal
LogicCircuits.Utils.variables — FunctionGet the BitSet of variables in the data structure
LogicCircuits.Utils.weigh_samples — MethodCreate a weighted copy of the data set