(opt, n_data)
| 3 | |
| 4 | |
| 5 | def build_mem(opt, n_data): |
| 6 | if opt.mem == 'bank': |
| 7 | mem_func = RGBMem if opt.modal == 'RGB' else CMCMem |
| 8 | memory = mem_func(opt.feat_dim, n_data, |
| 9 | opt.nce_k, opt.nce_t, opt.nce_m) |
| 10 | elif opt.mem == 'moco': |
| 11 | mem_func = RGBMoCo if opt.modal == 'RGB' else CMCMoCo |
| 12 | memory = mem_func(opt.feat_dim, opt.nce_k, opt.nce_t) |
| 13 | else: |
| 14 | raise NotImplementedError( |
| 15 | 'mem not suported: {}'.format(opt.mem)) |
| 16 | |
| 17 | return memory |