7a82079d10379287ba4e6e42e21b5b3ce8f541bc,spotlight/sequence/implicit.py,ImplicitSequenceModel,fit,#ImplicitSequenceModel#Any#Any#,100
Before Change
positive_prediction = self._net(user_representation,
sequence_var)
if self._loss == "adaptive_hinge":
raise NotImplementedError
else:
negative_items = sample_items(
self._num_items,
batch_sequence.size(),
random_state=self._random_state)
negative_var = Variable(
gpu(torch.from_numpy(negative_items), self._use_cuda)
)
negative_prediction = self._net(user_representation,
negative_var)
self._optimizer.zero_grad()
loss = loss_fnc(positive_prediction,
negative_prediction,
After Change
loss_fnc = pointwise_loss
elif self._loss == "bpr":
loss_fnc = bpr_loss
elif self._loss == "hinge":
loss_fnc = hinge_loss
else:
loss_fnc = adaptive_hinge_loss
for epoch_num in range(self._n_iter):
sequences = shuffle(sequences,
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 7
Instances
Project Name: maciejkula/spotlight
Commit Name: 7a82079d10379287ba4e6e42e21b5b3ce8f541bc
Time: 2017-07-13
Author: maciej.kula@gmail.com
File Name: spotlight/sequence/implicit.py
Class Name: ImplicitSequenceModel
Method Name: fit
Project Name: GPflow/GPflow
Commit Name: 8c65ef658930afecb7001ce671f15772a0a4b23b
Time: 2020-08-17
Author: art.art.v@gmail.com
File Name: gpflow/base.py
Class Name: Parameter
Method Name: __init__
Project Name: GPflow/GPflow
Commit Name: f3c511060ce62072a34a50319237d28b82d10448
Time: 2020-08-27
Author: dutordoirv@gmail.com
File Name: gpflow/base.py
Class Name: Parameter
Method Name: __init__