def get_ratio(self):
    if self.encoder_bert_dropout:
        frand = float(uniform(0, 1))
        if (self.encoder_bert_mixup and self.training):
            return [frand, (1 - frand)]
        if ((frand < self.encoder_bert_dropout_ratio) and self.training):
            return [1, 0]
        elif ((frand > (1 - self.encoder_bert_dropout_ratio)) and self.training):
            return [0, 1]
        else:
            return [0.5, 0.5]
    else:
        return [self.encoder_ratio, self.bert_ratio]
def get_ratio(self):
    if self.encoder_bert_dropout:
        frand = float(uniform(0, 1))
        if (self.encoder_bert_mixup and self.training):
            return [frand, (1 - frand)]
        if ((frand < self.encoder_bert_dropout_ratio) and self.training):
            return [1, 0]
        elif ((frand > (1 - self.encoder_bert_dropout_ratio)) and self.training):
            return [0, 1]
        else:
            return [0.5, 0.5]
    else:
        return [self.encoder_ratio, self.bert_ratio]