File size: 4,370 Bytes
e89a301 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 | [
{
"function_name": "ELCRecTrainer._instance_cl_one_pair_contrastive_learning",
"file_path": "trainers/elcrec_trainer.py",
"function_calls": [
{
"function_call_name": "torch.cat",
"functionality": "Concatenates tensors along a specified dimension.",
"input": "inputs, dim=0",
"output": "Tensor",
"location_or_namespace": "torch"
},
{
"function_call_name": "self.model",
"functionality": "Encodes sequences into representations.",
"input": "cl_batch",
"output": "Tensor (sequence embeddings)",
"location_or_namespace": ""
},
{
"function_call_name": "torch.matmul",
"functionality": "Matrix product of two tensors.",
"input": "cl_sequence_output, self.model.cluster_centers.T",
"output": "Tensor",
"location_or_namespace": "torch"
},
{
"function_call_name": "torch.argmin",
"functionality": "Returns indices of the minimum values along a dimension.",
"input": "dis, dim=-1",
"output": "Tensor",
"location_or_namespace": "torch"
},
{
"function_call_name": "torch.concat",
"functionality": "Concatenates tensors along a specified dimension.",
"input": "[cl_sequence_output, shift], dim=-1",
"output": "Tensor",
"location_or_namespace": "torch"
},
{
"function_call_name": "torch.mean",
"functionality": "Computes the mean value of elements along a dimension.",
"input": "cl_sequence_output, dim=1, keepdim=False",
"output": "Tensor",
"location_or_namespace": "torch"
},
{
"function_call_name": "torch.view",
"functionality": "Reshapes a tensor without changing its data.",
"input": "cl_sequence_output",
"output": "Tensor",
"location_or_namespace": "torch.Tensor"
},
{
"function_call_name": "torch.split",
"functionality": "Splits the tensor into chunks.",
"input": "cl_sequence_flatten, batch_size_original",
"output": "Tuple[Tensor, Tensor]",
"location_or_namespace": "torch"
},
{
"function_call_name": "self.cf_criterion",
"functionality": "",
"input": "cl_output_slice[0], cl_output_slice[1], intent_ids",
"output": "Tensor (contrastive loss)",
"location_or_namespace": ""
}
]
},
{
"function_name": "ELCRecTrainer.distance",
"file_path": "trainers/elcrec_trainer.py",
"function_calls": [
{
"function_call_name": "torch.sum",
"functionality": "Sum of tensor elements over given dimension.",
"input": "(x * x).sum(-1), (c * c).sum(-1)",
"output": "Tensor",
"location_or_namespace": "torch"
},
{
"function_call_name": "torch.reshape",
"functionality": "Gives a new shape to a tensor.",
"input": "intermediate tensors",
"output": "Tensor",
"location_or_namespace": "torch"
},
{
"function_call_name": "torch.repeat",
"functionality": "Repeats a tensor along specified dimensions.",
"input": "reshaped tensors",
"output": "Tensor",
"location_or_namespace": "torch"
},
{
"function_call_name": "torch.matmul",
"functionality": "Matrix product of two tensors.",
"input": "x, c.T",
"output": "Tensor",
"location_or_namespace": "torch"
}
]
}
]
|