pyprobound.utils

Typed helper functions.

Functions

avg_pool1d(tensor[, kernel])

Average pooling along the first dimension.

betaln(z_1, z_2)

Computes the natural logarithm of the beta function.

ceil_div(dividend, divisor)

Typed ceiling division.

clear_cache()

Calls the empty_cache() function matching the available GPU backends.

count_kmers(sequences[, kmer_length, vocabulary])

Returns a sparse count matrix of k-mers in a list of sequences.

floor_div(dividend, divisor)

Typed floor division.

get_ordinal(integer)

Converts an integer to a string with an ordinal suffix.

get_split_size(max_embedding_size, ...)

Calculates the minibatch needed to avoid GPU limits on tensor sizes.

log1mexp(tensor, /[, eps])

Computes the element-wise log1mexp in a numerically stable way.