bnelearn.mechanism.contests_single_item module

class bnelearn.mechanism.contests_single_item.CrowdsourcingContest(cuda: bool = True)[source]

Bases: Mechanism

Crowdsourcing Contest

run(bids: Tensor) Tuple[Tensor, Tensor][source]

Runs a (batch of) Crowdsourcing Contests.

If a effort tensor for multiple items is submitted, each item is auctioned independently of one another.

Parameters

efforts: torch.Tensor

of efforts with dimensions (*batch_sizes, n_players, n_items)

Returns

(allocation, payments): Tuple[torch.Tensor, torch.Tensor]
allocation: tensor of dimension (*batch_sizes x n_players x n_items),

Entry indicates which prize the corresponding contestant would have won

payments: tensor of dimension (*batch_sizes x n_players)

Total payment from player to auctioneer for her allocation in that batch.

class bnelearn.mechanism.contests_single_item.TullockContest(impact_function, cuda: bool = True)[source]

Bases: Mechanism

Tullock Contest

run(bids: Tensor) Tuple[Tensor, Tensor][source]

Runs a (batch of) Tullock Contests.

This function is meant for single-item contests. If a effort tensor for multiple items is submitted, each item is auctioned independently of one another.

Note that if multiple contestants submit the highest effort, we choose the first one.

Parameters

bids: torch.Tensor

of efforts with dimensions (*batch_sizes, n_players, n_items)

Returns

(winning_probs, payments): Tuple[torch.Tensor, torch.Tensor]
winning_probs: tensor of dimension (*batch_sizes x n_players x n_items),

Winning probabilities defined by the impact function and the contest success function

payments: tensor of dimension (*batch_sizes x n_players)

Total payment from player to auctioneer for her allocation in that batch.