Skip to content

distill::distillation::Distiller

Public Functions

Name
init(self self, float temperature =2.0, float alpha =0.5)
float compute_distillation_loss(self self, np.ndarray student_logits, list teacher_logprobs, list target_ids)
dict sweep_temperature(self self, np.ndarray student_logits, list teacher_logprobs, list target_ids, Optional temperatures[list] =None)

Protected Functions

Name
float _cross_entropy_loss(self self, np.ndarray logits, list target_ids)
float _kl_divergence_loss(self self, np.ndarray student_logits, list teacher_logprobs)

Protected Attributes

Name
_temperature
_alpha

Public Functions Documentation

function init

__init__(
    self self,
    float temperature =2.0,
    float alpha =0.5
)

function compute_distillation_loss

float compute_distillation_loss(
    self self,
    np.ndarray student_logits,
    list teacher_logprobs,
    list target_ids
)

function sweep_temperature

dict sweep_temperature(
    self self,
    np.ndarray student_logits,
    list teacher_logprobs,
    list target_ids,
    Optional temperatures[list] =None
)

Protected Functions Documentation

function _cross_entropy_loss

float _cross_entropy_loss(
    self self,
    np.ndarray logits,
    list target_ids
)

function _kl_divergence_loss

float _kl_divergence_loss(
    self self,
    np.ndarray student_logits,
    list teacher_logprobs
)

Protected Attributes Documentation

variable _temperature

_temperature;

variable _alpha

_alpha;

Updated on 2026-07-25 at 22:56:57 +0000