(x, drop_prob)
| 100 | |
| 101 | |
| 102 | def drop_path(x, drop_prob): |
| 103 | if drop_prob > 0.: |
| 104 | keep_prob = 1.-drop_prob |
| 105 | mask = Variable(torch.cuda.FloatTensor(x.size(0), 1, 1, 1).bernoulli_(keep_prob)) |
| 106 | x.div_(keep_prob) |
| 107 | x.mul_(mask) |
| 108 | return x |
| 109 | |
| 110 | |
| 111 | def create_exp_dir(path, scripts_to_save=None): |