Skip to content

Question about the position encoding of 'pe = 0.' code #19

@lishensuo

Description

@lishensuo

https://github.com/OmicsML/CellPLM/blob/b59ee7688b1bd2a745856a610248b46f15019a22/CellPLM/embedder/omics.py#L88C1-L101C17

In the last forwrd part of CellPLM/CellPLM/embedder/omics.py, I notice that the pe variable is always initialized as 0 and it seems that pe not related the coordinate encoding. Does it mean that x only includes the expression embed and batch embed? Could you explain the reasons? Thanks.

    def forward(self, x_dict, input_gene_list=None):
        x = self.feat_enc(x_dict, input_gene_list)#self.act(self.feat_enc(x_dict, input_gene_list))
        if self.pe_enc is not None:
            pe_input = x_dict[self.pe_enc.pe_key]
            pe = 0.#self.pe_enc(pe_input)
            if self.inject_covariate:
                pe = pe + self.cov_enc(x_dict['batch'])
            if self.cat_pe:
                x = torch.cat([x, pe], 1)
            else:
                x = x + pe
        x = self.extra_linear(x)
        # x = self.norm0(self.dropout(x))
        return x

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions