File size: 2,907 Bytes
22e9602
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
{
  "function_name": "training_losses",
  "file_path": "LightningDiT/transport/transport.py",
  "function_calls": [
    {
      "function_call_name": "sample",
      "functionality": "Samples a random time 't' and the corresponding start (x0, typically noise) and end (x1, the data) points of the transport path.",
      "input": "self, x1, sp_timesteps, shifted_mu",
      "output": "A tuple (t, x0, x1) containing the time, start point, and end point.",
      "location_or_namespace": "LightningDiT/transport/transport.py"
    },
    {
      "function_call_name": "plan",
      "functionality": "Based on a sampled time 't' and path endpoints 'x0' and 'x1', computes the interpolated state 'xt' and the target velocity 'ut' at that point on the path.",
      "input": "self, t, x0, x1",
      "output": "A tuple (t, xt, ut) containing the time, interpolated state, and target velocity.",
      "location_or_namespace": "LightningDiT/transport/path_sampler.py"
    },
    {
      "function_call_name": "mean_flat",
      "functionality": "Calculates the mean of a tensor over all dimensions except the first (batch) dimension.",
      "input": "tensor",
      "output": "A tensor of shape (B,) where B is the batch size of the input tensor.",
      "location_or_namespace": "LightningDiT/transport/utils.py"
    },
    {
      "function_call_name": "cosine_similarity",
      "functionality": "Computes the cosine similarity between two tensors along a given dimension.",
      "input": "input1, input2, dim=1, eps=1e-8",
      "output": "A tensor containing the cosine similarity values.",
      "location_or_namespace": "torch.nn.functional"
    },
    {
      "function_call_name": "compute_drift",
      "functionality": "Computes the drift and its variance for the transport path at a given state and time.",
      "input": "self, x, t",
      "output": "A tuple containing the drift and its variance.",
      "location_or_namespace": "LightningDiT/transport/path_sampler.py"
    },
    {
      "function_call_name": "compute_sigma_t",
      "functionality": "Computes the noise standard deviation 'sigma_t' at a given time 't'.",
      "input": "self, t",
      "output": "A tuple containing sigma_t and its time derivative.",
      "location_or_namespace": "LightningDiT/transport/path_sampler.py"
    },
    {
      "function_call_name": "expand_t_like_x",
      "functionality": "Reshapes the time tensor 't' to be broadcastable with the data tensor 'x'.",
      "input": "t, x",
      "output": "A reshaped time tensor.",
      "location_or_namespace": "LightningDiT/transport/path.py"
    },
    {
      "function_call_name": "NotImplementedError",
      "functionality": "Raises a NotImplementedError exception, indicating that an unimplemented code path has been reached.",
      "input": "message",
      "output": "Raises an exception.",
      "location_or_namespace": "builtins"
    }
  ]
}