bnelearn.mechanism.auctions_single_item module

class bnelearn.mechanism.auctions_single_item.AllPayAuction(cuda: bool)[source]

Bases: Mechanism

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

Runs a (batch of) All-Pay Auctions.

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

Parameters

bids: torch.Tensor

of bids 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),

1 indicating item is allocated to corresponding player in that batch, 0 otherwise

payments: tensor of dimension (*batch_sizes x n_players)

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

class bnelearn.mechanism.auctions_single_item.FirstPriceSealedBidAuction(**kwargs)[source]

Bases: Mechanism

First Price Sealed Bid auction

run(bids: Tensor, smooth_market: bool = False) Tuple[Tensor, Tensor][source]

Runs a (batch of) First Price Sealed Bid Auction.

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

Parameters

bids: torch.Tensor

of bids 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),

1 indicating item is allocated to corresponding player in that batch, 0 otherwise

payments: tensor of dimension (*batch_sizes x n_players)

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

class bnelearn.mechanism.auctions_single_item.ThirdPriceSealedBidAuction(cuda: bool = True, smoothing_temperature: Optional[float] = None)[source]

Bases: Mechanism

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

Runs a (batch of) Third Price Sealed Bid Auctions.

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

Parameters

bids: torch.Tensor

of bids with dimensions (batch_size, n_players, n_items)

Returns

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

1 indicating item is allocated to corresponding player in that batch, 0 otherwise

payments: tensor of dimension (n_batches x n_players)

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

class bnelearn.mechanism.auctions_single_item.VickreyAuction(random_tie_break: bool = False, **kwargs)[source]

Bases: Mechanism

Vickrey / Second Price Sealed Bid Auctions

run(bids: Tensor, smooth_market: bool = False) Tuple[Tensor, Tensor][source]

Runs a (batch of) Vickrey/Second Price Sealed Bid Auctions.

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

Parameters

bids: torch.Tensor

of bids with dimensions (batch_size, n_players, n_items)

smooth_market: Smoothens allocations and payments s.t. the ex-post

utility is continuous again. This introduces a bias though. PG then is applicable.

Returns

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

1 indicating item is allocated to corresponding player in that batch, 0 otherwise

payments: tensor of dimension (n_batches x n_players)

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