pulsatrix 1.1.0
Loading...
Searching...
No Matches
pulsatrix::CausalLMStepModel Class Referencefinal

A CausalLM with bidirectional attention (an A2D diffusion model, DIFF-4) as a StepRelevanceModel, with the same rules as EncoderLMStepModel. More...

#include <masked_diffusion_lrp.hpp>

Inheritance diagram for pulsatrix::CausalLMStepModel:
Collaboration diagram for pulsatrix::CausalLMStepModel:

Public Member Functions

 CausalLMStepModel (CausalLM &model, DeviceBackend *backend, LRPRuleConfig config=LxtAttnLrpConfig())
 
std::vector< float > forward (const std::vector< int64_t > &tokens) override
 Logits for every position, L * vocab values, row-major.
 
std::vector< float > relevance (const std::vector< float > &relevance_logits) override
 Relevance per input position, L values, from relevance on the last forward()'s logits (L * vocab).
 
- Public Member Functions inherited from pulsatrix::StepRelevanceModel
virtual ~StepRelevanceModel ()=default
 

Detailed Description

A CausalLM with bidirectional attention (an A2D diffusion model, DIFF-4) as a StepRelevanceModel, with the same rules as EncoderLMStepModel.

Constructor & Destructor Documentation

◆ CausalLMStepModel()

pulsatrix::CausalLMStepModel::CausalLMStepModel ( CausalLM &  model,
DeviceBackend *  backend,
LRPRuleConfig  config = LxtAttnLrpConfig() 
)
Parameters
backendWhere the model runs. The model and backend must outlive this.
Exceptions
std::invalid_argumentif the model is causal.

Member Function Documentation

◆ forward()

std::vector< float > pulsatrix::CausalLMStepModel::forward ( const std::vector< int64_t > &  tokens)
overridevirtual

Logits for every position, L * vocab values, row-major.

Implements pulsatrix::StepRelevanceModel.

◆ relevance()

std::vector< float > pulsatrix::CausalLMStepModel::relevance ( const std::vector< float > &  relevance_logits)
overridevirtual

Relevance per input position, L values, from relevance on the last forward()'s logits (L * vocab).

Implements pulsatrix::StepRelevanceModel.


The documentation for this class was generated from the following file: