-
Notifications
You must be signed in to change notification settings - Fork 0
/
dnns_encoder.h
32 lines (25 loc) · 1.13 KB
/
dnns_encoder.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#ifndef BRIDGE_LIB_DNNS_ENCODER_H
#define BRIDGE_LIB_DNNS_ENCODER_H
#include "observation_encoder.h"
namespace bridge_learning_env {
inline constexpr int kDNNsBiddingHistoryTensorSize = kMaxAuctionLength;
int EncodeHandRankMajorClubsStartStyle(const BridgeObservation& obs,
int start_offset,
std::vector<int>* encoding,
int relative_player);
int EncodeDNNsBiddingHistory(const BridgeObservation& obs, int start_offset,
std::vector<int>* encoding);
class DNNsEncoder : public ObservationEncoder {
public:
std::vector<int> Shape() const override {
return {kNumCards + kNumPartnerships + kDNNsBiddingHistoryTensorSize};
}
Type type() const override { return kDNNS; }
std::vector<int> Encode(const BridgeObservation& obs,
const std::unordered_map<std::string, std::any> &kwargs = {}) const override;
ObservationEncoder::EncoderPhase EncodingPhase() const override{
return kAuction;
}
};
} // namespace bridge_learning_env
#endif /* BRIDGE_LIB_DNNS_ENCODER_H */