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

Method get_logits

models/base/Network.py:87–91  ·  view source on GitHub ↗
(self,x,fc)

Source from the content-addressed store, hash-verified

85 return new_fc
86
87 def get_logits(self,x,fc):
88 if 'dot' in self.args.new_mode:
89 return F.linear(x,fc)
90 elif 'cos' in self.args.new_mode:
91 return self.args.temperature * F.linear(F.normalize(x, p=2, dim=-1), F.normalize(fc, p=2, dim=-1))
92
93 def update_fc_ft(self,new_fc,data,label,session):
94 new_fc=new_fc.clone().detach()

Callers 1

update_fc_ftMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected