LeakGAN icon indicating copy to clipboard operation
LeakGAN copied to clipboard

I think the Bootstrapped Rescaled Activation in the code is not useful

Open 3015218116 opened this issue 5 years ago • 3 comments

def rescale( reward, rollout_num=1.0): reward = np.array(reward) x, y = reward.shape ret = np.zeros((x, y)) for i in range(x): l = reward[i] rescalar = {} for s in l: rescalar[s] = s idxx = 1 min_s = 1.0 max_s = 0.0 for s in rescalar: rescalar[s] = redistribution(idxx, len(l), min_s) idxx += 1 for j in range(y): ret[i, j] = rescalar[reward[i, j]] return ret

I read the code, but I didn't see any sorting behavior, more like scaling by insertion order. If this code is collating, "for s in rescalar," it might be more reasonable to read it in some sort order. Please advise, thank you very much.

3015218116 avatar Dec 05 '18 12:12 3015218116

The sorting operation is hidden behind the the implementation of the Python ``map'' object. As it is implemented by a binary search tree, which automatically sort the inserted elements, the operation to iterate through its key element (for s in rescalar, if you may notice) would result in a ordered visit of them. Hope this note helps.

desire2020 avatar Mar 17 '19 23:03 desire2020

@desire2020 That is not true. dict keys are iterated over in a random order.

joonazan avatar Mar 08 '20 15:03 joonazan

I have the same question. dict keys are iterated over in random order. Is it have any explanation?

Kljon avatar May 13 '20 08:05 Kljon