def variable_mapping(self):
    '映射到官方ALBERT权重格式\n        '
    mapping = super(ALBERT_Unshared, self).variable_mapping()
    prefix = 'bert/encoder/transformer/group_0/inner_group_0/'
    for i in range(self.num_hidden_layers):
        mapping.update({('Transformer-%d-MultiHeadSelfAttention' % i): [(prefix + 'attention_1/self/query/kernel'), (prefix + 'attention_1/self/query/bias'), (prefix + 'attention_1/self/key/kernel'), (prefix + 'attention_1/self/key/bias'), (prefix + 'attention_1/self/value/kernel'), (prefix + 'attention_1/self/value/bias'), (prefix + 'attention_1/output/dense/kernel'), (prefix + 'attention_1/output/dense/bias')], ('Transformer-%d-MultiHeadSelfAttention-Norm' % i): [(prefix + 'LayerNorm/beta'), (prefix + 'LayerNorm/gamma')], ('Transformer-%d-FeedForward' % i): [(prefix + 'ffn_1/intermediate/dense/kernel'), (prefix + 'ffn_1/intermediate/dense/bias'), (prefix + 'ffn_1/intermediate/output/dense/kernel'), (prefix + 'ffn_1/intermediate/output/dense/bias')], ('Transformer-%d-FeedForward-Norm' % i): [(prefix + 'LayerNorm_1/beta'), (prefix + 'LayerNorm_1/gamma')]})
    return mapping
映射到官方ALBERT权重格式
def variable_mapping(self):
    '\n        '
    mapping = super(ALBERT_Unshared, self).variable_mapping()
    prefix = 'bert/encoder/transformer/group_0/inner_group_0/'
    for i in range(self.num_hidden_layers):
        mapping.update({('Transformer-%d-MultiHeadSelfAttention' % i): [(prefix + 'attention_1/self/query/kernel'), (prefix + 'attention_1/self/query/bias'), (prefix + 'attention_1/self/key/kernel'), (prefix + 'attention_1/self/key/bias'), (prefix + 'attention_1/self/value/kernel'), (prefix + 'attention_1/self/value/bias'), (prefix + 'attention_1/output/dense/kernel'), (prefix + 'attention_1/output/dense/bias')], ('Transformer-%d-MultiHeadSelfAttention-Norm' % i): [(prefix + 'LayerNorm/beta'), (prefix + 'LayerNorm/gamma')], ('Transformer-%d-FeedForward' % i): [(prefix + 'ffn_1/intermediate/dense/kernel'), (prefix + 'ffn_1/intermediate/dense/bias'), (prefix + 'ffn_1/intermediate/output/dense/kernel'), (prefix + 'ffn_1/intermediate/output/dense/bias')], ('Transformer-%d-FeedForward-Norm' % i): [(prefix + 'LayerNorm_1/beta'), (prefix + 'LayerNorm_1/gamma')]})
    return mapping