|
def hash_state_action(s_t, a_t): |
|
key = s_t[0] |
|
base = 179424673 |
|
for e in s_t[1].directed_edges: |
|
key = (key * base + e[0]) % base |
|
key = (key * base + e[1]) % base |
|
if s_t[2] is not None: |
|
key = (key * base + s_t[2]) % base |
|
else: |
|
key = (key * base) % base |
|
|
|
key = (key * base + a_t) % base |
|
return key |
Is this hash function problematic? It seems that this function is equivalent to key = a_t % base.
graph_adversarial_attack/code/graph_attack/nstep_replay_mem.py
Lines 54 to 66 in 57b2853
Is this hash function problematic? It seems that this function is equivalent to
key = a_t % base.