SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2110.12985 · NeurIPS · 2021

Goal-Aware Cross-Entropy for Multi-Target Reinforcement Learning

Byoung-Tak Zhang, Kibeom Kim, Minsu Lee, Yoonsung Kim, Je-Hwan Ryu, Surromind

arXiv · PDF · Open in the Atlas

Code that ran

5 of 6 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (2 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 4 have no contract verdict; 1 failure of our instrument; 1 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2110.12985.json · badge: /api/ran/2110.12985.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
kibeomKim/GACE-GDAN canonical (classifier label)
classifier basis: classifier_2025
1 ran · 1 no recorded run
kibeomkim/gace-gdan marked official in Papers with Code
Papers with Code archive
4 ran · 0 no recorded run
FunctionStatusWhere it lives
Actor_Critic Ran
ran on a synthesized input
kibeomkim/gace-gdan/GACE_GDAN/models.py
code served (permissive licence) · get_code("b25b0b4bdba58c8f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
import torch.nn.functional as F

class Actor_Critic(nn.Module):

    def __init__(self):
        super(Actor_Critic, self).__init__()
        self.embedding = nn.Embedding(4, 25)
        self.target_att_linear = nn.Linear(25, 256)
        self.lstm = nn.LSTMCell(512, 256)
        self.layer_query = nn.Linear(256, 256)
        self.layer_key = nn.Linear(256, 256)
        self.before_attn = nn.Linear(512, 512)
        self.attn = nn.Linear(512, 256)
        self.mlp_policy1 = nn.Linear(256, 128)
        self.mlp_policy2 = nn.Linear(128, 64)
        self.policy = nn.Linear(64, 3)
        self.mlp_value1 = nn.Linear(256, 64)
        self.mlp_value2 = nn.Linear(64, 32)
        self.value = nn.Linear(32, 1)

    def forward(self, img_feat, instruction_idx, _hx, _cx, query):
        word_embedding = self.embedding(instruction_idx)
        word_embedding = word_embedding.view(word_embedding.size(0), -1)
        word_embedding = self.target_att_linear(word_embedding)
        gated_att = torch.sigmoid(word_embedding)
        gated_fusion = torch.mul(img_feat, gated_att)
        lstm_input = torch.cat([gated_fusion, gated_att], 1)
        hx, cx = self.lstm(lstm_input, (_hx, _cx))
        mlp_input = torch.cat([gated_fusion, hx], 1)
        mlp_attn = F.relu(self.before_attn(mlp_input))
        key, value = torch.chunk(mlp_attn, 2, dim=1)
        w_q = F.relu(self.layer_query(query))
        w_k = F.relu(self.layer_key(key))
        u_t = torch.tanh(w_q + w_k)
        attention_vector = torch.mul(u_t, value)
        attn_weight = torch.cat([attention_vector, hx], 1)
        attn_weight = F.relu(self.attn(attn_weight))
        policy = F.relu(self.mlp_policy1(attn_weight))
        policy = F.relu(self.mlp_policy2(policy))
        value = F.relu(self.mlp_value1(attn_weight))
        value = F.relu(self.mlp_value2(value))
        return (self.value(value), self.policy(policy), hx, cx)

INIT_ARGS = {}

ARGS = {
    'img_feat': torch.randn(2, 256),
    'instruction_idx': torch.randint(0, 4, (2,)),
    '_hx': torch.randn(2, 256),
    '_cx': torch.randn(2, 256),
    'query': torch.randn(2, 256),
}

model = Actor_Critic()
output = model(**ARGS)
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
Feature_Extractor Ran
ran on a synthesized input · constructed an object; no result was computed
kibeomkim/gace-gdan/GACE_GDAN/models.py
code served (permissive licence) · get_code("486178b159d9a858")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, Feature_Extractor: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
import torch.nn.functional as F

torch.manual_seed(0)

class Feature_Extractor(nn.Module):

    def __init__(self):
        super(Feature_Extractor, self).__init__()
        self.conv1 = nn.Conv2d(16, 32, kernel_size=3, stride=2, padding=1)
        self.batchnorm1 = nn.BatchNorm2d(32, track_running_stats=False)
        self.conv2 = nn.Conv2d(32, 32, kernel_size=3, stride=2, padding=1)
        self.batchnorm2 = nn.BatchNorm2d(32, track_running_stats=False)
        self.conv3 = nn.Conv2d(32, 64, kernel_size=3, stride=2, padding=1)
        self.batchnorm3 = nn.BatchNorm2d(64, track_running_stats=False)
        self.conv4 = nn.Conv2d(64, 64, kernel_size=3, stride=2, padding=1)
        self.batchnorm4 = nn.BatchNorm2d(64, track_running_stats=False)
        self.fc = nn.Linear(64 * 3 * 3, 256)

    def forward(self, state):
        x = state
        x = F.relu(self.batchnorm1(self.conv1(x)))
        x = F.relu(self.batchnorm2(self.conv2(x)))
        x = F.relu(self.batchnorm3(self.conv3(x)))
        x = F.relu(self.batchnorm4(self.conv4(x)))
        x = x.view(x.size(0), -1)
        img_feat = F.relu(self.fc(x))
        return img_feat

extractor = Feature_Extractor()
state = torch.randn(2, 16, 48, 48)

ARGS = {}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Feature_Extractor — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Feature_Extractor output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
GDAN Ran
ran on a synthesized input
kibeomkim/gace-gdan/GACE_GDAN/models.py
code served (permissive licence) · get_code("2eb8379568cea70d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
import torch.nn.functional as F

# Import the classes from the provided code
class Actor_Critic(nn.Module):

    def __init__(self):
        super(Actor_Critic, self).__init__()
        self.embedding = nn.Embedding(4, 25)
        self.target_att_linear = nn.Linear(25, 256)
        self.lstm = nn.LSTMCell(512, 256)
        self.layer_query = nn.Linear(256, 256)
        self.layer_key = nn.Linear(256, 256)
        self.before_attn = nn.Linear(512, 512)
        self.attn = nn.Linear(512, 256)
        self.mlp_policy1 = nn.Linear(256, 128)
        self.mlp_policy2 = nn.Linear(128, 64)
        self.policy = nn.Linear(64, 3)
        self.mlp_value1 = nn.Linear(256, 64)
        self.mlp_value2 = nn.Linear(64, 32)
        self.value = nn.Linear(32, 1)

    def forward(self, img_feat, instruction_idx, _hx, _cx, query):
        word_embedding = self.embedding(instruction_idx)
        word_embedding = word_embedding.view(word_embedding.size(0), -1)
        word_embedding = self.target_att_linear(word_embedding)
        gated_att = torch.sigmoid(word_embedding)
        gated_fusion = torch.mul(img_feat, gated_att)
        lstm_input = torch.cat([gated_fusion, gated_att], 1)
        hx, cx = self.lstm(lstm_input, (_hx, _cx))
        mlp_input = torch.cat([gated_fusion, hx], 1)
        mlp_attn = F.relu(self.before_attn(mlp_input))
        key, value = torch.chunk(mlp_attn, 2, dim=1)
        w_q = F.relu(self.layer_query(query))
        w_k = F.relu(self.layer_key(key))
        u_t = torch.tanh(w_q + w_k)
        attention_vector = torch.mul(u_t, value)
        attn_weight = torch.cat([attention_vector, hx], 1)
        attn_weight = F.relu(self.attn(attn_weight))
        policy = F.relu(self.mlp_policy1(attn_weight))
        policy = F.relu(self.mlp_policy2(policy))
        value = F.relu(self.mlp_value1(attn_weight))
        value = F.relu(self.mlp_value2(value))
        return (self.value(value), self.policy(policy), hx, cx)

class Feature_Extractor(nn.Module):

    def __init__(self):
        super(Feature_Extractor, self).__init__()
        self.conv1 = nn.Conv2d(16, 32, kernel_size=3, stride=2, padding=1)
        self.batchnorm1 = nn.BatchNorm2d(32, track_running_stats=False)
        self.conv2 = nn.Conv2d(32, 32, kernel_size=3, stride=2, padding=1)
        self.batchnorm2 = nn.BatchNorm2d(32, track_running_stats=False)
        self.conv3 = nn.Conv2d(32, 64, kernel_size=3, stride=2, padding=1)
        self.batchnorm3 = nn.BatchNorm2d(64, track_running_stats=False)
        self.conv4 = nn.Conv2d(64, 64, kernel_size=3, stride=2, padding=1)
        self.batchnorm4 = nn.BatchNorm2d(64, track_running_stats=False)
        self.fc = nn.Linear(64 * 3 * 3, 256)

    def forward(self, state):
        x = state
        x = F.relu(self.batchnorm1(self.conv1(x)))
        x = F.relu(self.batchnorm2(self.conv2(x)))
        x = F.relu(self.batchnorm3(self.conv3(x)))
        x = F.relu(self.batchnorm4(self.conv4(x)))
        x = x.view(x.size(0), -1)
        img_feat = F.relu(self.fc(x))
        return img_feat

class Goal_discriminator(nn.Module):

    def __init__(self):
        super(Goal_discriminator, self).__init__()
        self.linear1 = nn.Linear(256, 256)
        self.linear2 = nn.Linear(256, 4)

    def forward(self, img_feat):
        query = F.relu(self.linear1(img_feat))
        x = self.linear2(query)
        return (x, query)

class GDAN(nn.Module):

    def __init__(self):
        super(GDAN, self).__init__()
        self.sigma = Feature_Extractor()
        self.d = Goal_discriminator()
        self.f = Actor_Critic()

    def forward(self, state, instruction, _hx, _cx, use_ActorCritic=True):
        preds, value, policy, hx, cx = (None, None, None, None, None)
        e_t = self.sigma(state)
        preds, query = self.d(e_t)
        if use_ActorCritic:
            value, policy, hx, cx = self.f(e_t, instruction, _hx, _cx, query)
        return (preds, value, policy, hx, cx)


INIT_ARGS = {}

ARGS = {
    'state': torch.randn(2, 16, 48, 48),
    'instruction': torch.randint(0, 4, (2, 1)),
    '_hx': torch.randn(2, 256),
    '_cx': torch.randn(2, 256),
    'use_ActorCritic': True,
}
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
Goal_discriminator Ran
ran on a synthesized input · constructed an object; no result was computed
kibeomkim/gace-gdan/GACE_GDAN/models.py
code served (permissive licence) · get_code("e3410ab0605200d8")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, Goal_discriminator: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

ARGS = {}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Goal_discriminator — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Goal_discriminator output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
postprocess Ran
ran; our contract draft was wrong, not the code
kibeomKim/GACE-GDAN/GACE_GDAN/agent.py
code served (permissive licence) · get_code("5f451cdfc6e5e92b")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn.functional as F
from torch.autograd import Variable

torch.manual_seed(0)

# Create a small logit tensor
# Shape: (batch_size=2, num_classes=4)
logit = torch.randn(2, 4)

ARGS = {
    "logit": logit
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
preprocess Not yet run
unverified (harvested, no recorded run)
kibeomKim/GACE-GDAN/GACE_GDAN/agent.py
code served (permissive licence) · get_code("c579940fb7d7687f")
How it ran

no invocation recorded.

Also present in other papers' code

Of 6 samples lifted from this paper's linked repositories, 6 carry a function identity and 0 do not. Of the 6 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 6 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Learning in a multi-target environment without prior knowledge about the targets requires a large amount of samples and makes generalization difficult. To solve this problem, it is important to be able to discriminate targets through semantic understanding. In this paper, we propose goal-aware cross-entropy (GACE) loss, that can be utilized in a self-supervised way using auto-labeled goal states alongside reinforcement learning. Based on the loss, we then devise goal-discriminative attention networks (GDAN) which utilize the goal-relevant information to focus on the given instruction. We evaluate the proposed methods on visual navigation and robot arm manipulation tasks with multi-target environments and show that GDAN outperforms the state-of-the-art methods in terms of task success ratio, sample efficiency, and generalization. Additionally, qualitative analyses demonstrate that our proposed method can help the agent become aware of and focus on the given instruction clearly, promoting goal-directed behavior.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2110.12985")
get_code_for_paper("2110.12985")
have("2110.12985")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2110.12985.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2110.12985.svg)](https://syntology.ai/paper/2110.12985)

Connect an agent — have() is free.