MCPcopy Create free account
hub / github.com/LAMDA-CL/CVPR22-Fact / get_logits

Method get_logits

models/fact/Network.py:156–160  ·  view source on GitHub ↗
(self,x,fc)

Source from the content-addressed store, hash-verified

154 return new_fc
155
156 def get_logits(self,x,fc):
157 if 'dot' in self.args.new_mode:
158 return F.linear(x,fc)
159 elif 'cos' in self.args.new_mode:
160 return self.args.temperature * F.linear(F.normalize(x, p=2, dim=-1), F.normalize(fc, p=2, dim=-1))
161
162 def update_fc_ft(self,new_fc,data,label,session):
163 new_fc=new_fc.clone().detach()

Callers 1

update_fc_ftMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected