fix: train set can get 1.0 found score
but unseen val only get about 0.44 found score I ignore the target object when this is the adversarial instruction
This commit is contained in:
parent
da0640ab06
commit
9e5d2f95ba
@ -231,7 +231,7 @@ class Seq2SeqAgent(BaseAgent):
|
|||||||
else:
|
else:
|
||||||
candidate_objs = ob['candidate_obj'][2]
|
candidate_objs = ob['candidate_obj'][2]
|
||||||
for k, kid in enumerate(candidate_objs):
|
for k, kid in enumerate(candidate_objs):
|
||||||
if kid == ob['objId']:
|
if kid == ob['objId'] and ob['found']:
|
||||||
a[i] = k
|
a[i] = k
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
@ -454,10 +454,28 @@ class Seq2SeqAgent(BaseAgent):
|
|||||||
'''
|
'''
|
||||||
|
|
||||||
''' Supervised training for REF '''
|
''' Supervised training for REF '''
|
||||||
|
|
||||||
if train_ml is not None:
|
if train_ml is not None:
|
||||||
target_obj = self._teacher_REF(perm_obs, just_ended)
|
target_obj = self._teacher_REF(perm_obs, just_ended)
|
||||||
ref_loss += self.criterion_REF(logit_REF, target_obj)
|
ref_loss += self.criterion_REF(logit_REF, target_obj)
|
||||||
|
'''
|
||||||
|
print("LENG ", candidate_leng)
|
||||||
|
print("TARGET:", target)
|
||||||
|
print("OBJ: ", target_obj)
|
||||||
|
print()
|
||||||
|
|
||||||
|
for index, ob in enumerate(perm_obs):
|
||||||
|
if target[index] == visual_temp_mask.size(1):
|
||||||
|
output = -1
|
||||||
|
elif target[index] == (candidate_leng[index]-1):
|
||||||
|
output = -2
|
||||||
|
else:
|
||||||
|
output = target[index].item()
|
||||||
|
print(index, candidate_leng[index], cpu_a_t[index], a_t.cpu().numpy()[index], target[index].item(), output)
|
||||||
|
print(target_obj[index].item(), ob['found'])
|
||||||
|
|
||||||
|
print()
|
||||||
|
'''
|
||||||
# print('logit', logit)
|
# print('logit', logit)
|
||||||
# print('logit_REF', logit_REF)
|
# print('logit_REF', logit_REF)
|
||||||
# print('just_ended', just_ended)
|
# print('just_ended', just_ended)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user