multiml.task.pytorch.modules.asng_util module
- class multiml.task.pytorch.modules.asng_util.asng_category(categories=None, init_theta=None, range_restriction=True)
Bases:
object
- __init__(categories=None, init_theta=None, range_restriction=True)
- get_n()
- get_theta()
- set_theta(theta)
- get_most_likely()
Get most likely categorical variables (one-hot)
- sampling(lam)
- calc_theta(c_cat, aru, idx)
- update_theta(eps)
- class multiml.task.pytorch.modules.asng_util.asng_integer(integers=None, init_theta=None)
Bases:
object
- __init__(integers=None, init_theta=None)
- get_n()
- get_theta()
- set_theta(theta)
- get_most_likely()
- sampling(lam)
- calc_theta(c_int, aru, idx)
- update_theta()
- multiml.task.pytorch.modules.asng_util.ranking_based_utility_transformation(losses, lam, rho=0.25, negative=True)
Ranking Based Utility Transformation.
- w(f(x)) / lambda =
1/mu if rank(x) <= mu 0 if mu < rank(x) < lambda - mu -1/mu if lambda - mu <= rank(x)
where rank(x) is the number of at least equally good points, including it self.
The number of good and bad points, mu, is ceil(lambda/4). That is,
mu = 1 if lambda = 2 mu = 1 if lambda = 4 mu = 2 if lambda = 6, etc.
If there exist tie points, the utility values are equally distributed for these points.