rime.util.score_array

Functions

auto_cast_lazy_score(other)

auto_device()

auto_tensor(x[, device])

batch_op_iter(S, op[, device])

find_iloc(old_index, new_index[, allow_missing])

get_batch_size(shape)

round to similar batch sizes

matrix_reindex(csr, old_index, new_index, axis)

pandas.reindex functionality on sparse or dense matrices as well as 1d arrays

score_op(S, op[, device, reduce_fn])

aggregation operations (e.g., max, min, sum) across entire matrix

sps_to_torch(x, device)

convert scipy.sparse to torch.sparse

Classes

ElementWiseExpression(op, children)

Tree representation of an element-wise expression; auto-broadcast

LazyDenseMatrix(c)

cast scalar and arrays to 2-d arrays

LazyExpressionBase(op, children)

LazyScoreBase(shape)

low-rank, sparse, and other expressions with deferred evaluations after subsampling

LazyScoreModel(user_index, item_index[, ...])

LazySparseMatrix(c)

MatMulExpression(op, children)

RandScore(row_seeds, col_seeds[, distn])

add random noise to break ties

VAEExpression(op, children)

op=_VAEOp, [weight (n, 2d), randn (n, d)], auto-broadcast on d-axis