Commit 04efda84 authored by sbl1996@126.com's avatar sbl1996@126.com

Add negated

parent 7e87d523
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
- race: 1, int, 0: N/A, same as race2str - race: 1, int, 0: N/A, same as race2str
- level: 1, int, 0: N/A - level: 1, int, 0: N/A
- counter: 1, int, 0: N/A - counter: 1, int, 0: N/A
- negated: 1, int, 0: False, 1: True
- atk: 2, max 65535 to 2 bytes - atk: 2, max 65535 to 2 bytes
- def: 2, max 65535 to 2 bytes - def: 2, max 65535 to 2 bytes
- type: 25, multi-hot, same as type2str - type: 25, multi-hot, same as type2str
......
...@@ -60,12 +60,13 @@ class Encoder(nn.Module): ...@@ -60,12 +60,13 @@ class Encoder(nn.Module):
self.id_norm = nn.LayerNorm(c // 4, elementwise_affine=False) self.id_norm = nn.LayerNorm(c // 4, elementwise_affine=False)
self.owner_embed = nn.Embedding(2, c // 16) self.owner_embed = nn.Embedding(2, c // 16)
self.position_embed = nn.Embedding(9, c // 16 * 2) self.position_embed = nn.Embedding(9, c // 16)
self.overley_embed = nn.Embedding(2, c // 16) self.overley_embed = nn.Embedding(2, c // 16)
self.attribute_embed = nn.Embedding(8, c // 16) self.attribute_embed = nn.Embedding(8, c // 16)
self.race_embed = nn.Embedding(27, c // 16) self.race_embed = nn.Embedding(27, c // 16)
self.level_embed = nn.Embedding(14, c // 16) self.level_embed = nn.Embedding(14, c // 16)
self.counter_embed = nn.Embedding(16, c // 16) self.counter_embed = nn.Embedding(16, c // 16)
self.negated_embed = nn.Embedding(3, c // 16)
self.type_fc_emb = linear(25, c // 16 * 2) self.type_fc_emb = linear(25, c // 16 * 2)
self.atk_fc_emb = linear(c_num, c // 16) self.atk_fc_emb = linear(c_num, c // 16)
self.def_fc_emb = linear(c_num, c // 16) self.def_fc_emb = linear(c_num, c // 16)
...@@ -224,7 +225,8 @@ class Encoder(nn.Module): ...@@ -224,7 +225,8 @@ class Encoder(nn.Module):
x_race = self.race_embed(x1[:, :, 6]) x_race = self.race_embed(x1[:, :, 6])
x_level = self.level_embed(x1[:, :, 7]) x_level = self.level_embed(x1[:, :, 7])
x_counter = self.counter_embed(x1[:, :, 8]) x_counter = self.counter_embed(x1[:, :, 8])
return x_owner, x_position, x_overley, x_attribute, x_race, x_level, x_counter x_negated = self.negated_embed(x1[:, :, 9])
return x_owner, x_position, x_overley, x_attribute, x_race, x_level, x_counter, x_negated
def encode_card_feat2(self, x2): def encode_card_feat2(self, x2):
x_atk = self.num_transform(x2[:, :, 0:2]) x_atk = self.num_transform(x2[:, :, 0:2])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment