project_name string | class_name string | class_modifiers string | class_implements int64 | class_extends int64 | function_name string | function_body string | cyclomatic_complexity int64 | NLOC int64 | num_parameter int64 | num_token int64 | num_variable int64 | start_line int64 | end_line int64 | function_index int64 | function_params string | function_variable string | function_return_type string | function_body_line_type string | function_num_functions int64 | function_num_lines int64 | outgoing_function_count int64 | outgoing_function_names string | incoming_function_count int64 | incoming_function_names string | lexical_representation string |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
CAREamics_careamics | UnetEncoder | public | 0 | 1 | forward | def forward(self, *features: torch.Tensor) -> torch.Tensor:"""Forward pass.Parameters----------*features :list[torch.Tensor]List containing the output of each encoder block(skip connections) and finaloutput of the encoder.Returns-------torch.TensorOutput of the decoder."""x: torch.Tensor = features[0]skip_connections: ... | 6 | 12 | 2 | 132 | 0 | 234 | 263 | 234 | self,x | [] | list[torch.Tensor] | {"Assign": 3, "Expr": 2, "For": 1, "If": 1, "Return": 1} | 3 | 22 | 3 | ["module", "isinstance", "encoder_features.append"] | 54 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3646986_mapbox_mapbox_sdk_py.tests.test_geocoder_py.test_geocoder_forward", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3646986_mapbox_mapbox_sdk_py.tests.test_geocoder_py.test_geocoder_forward_bbox", "_.content.g... | The function (forward) defined within the public class called UnetEncoder, that inherit another class.The function start at line 234 and ends at 263. It contains 12 lines of code and it has a cyclomatic complexity of 6. It takes 2 parameters, represented as [234.0] and does not return any value. It declares 3.0 functio... |
CAREamics_careamics | UnetDecoder | public | 0 | 1 | _interleave | def _interleave(A: torch.Tensor, B: torch.Tensor, groups: int) -> torch.Tensor:"""Interleave two tensors.Splits the tensors `A` and `B` into equally sized groups along the channelaxis (axis=1); then concatenates the groups in alternating order along thechannel axis, starting with the first group from tensor A.Parameter... | 7 | 20 | 3 | 178 | 0 | 266 | 314 | 266 | A,B,groups | [] | torch.Tensor | {"AnnAssign": 2, "Assign": 3, "Expr": 1, "If": 1, "Return": 1} | 5 | 49 | 5 | ["ValueError", "range", "range", "torch.cat", "range"] | 0 | [] | The function (_interleave) defined within the public class called UnetDecoder, that inherit another class.The function start at line 266 and ends at 314. It contains 20 lines of code and it has a cyclomatic complexity of 7. It takes 3 parameters, represented as [266.0] and does not return any value. It declares 5.0 fun... |
CAREamics_careamics | UnetEncoder | public | 0 | 1 | __init__ | def __init__(self,conv_dims: int,num_classes: int = 1,in_channels: int = 1,depth: int = 3,num_channels_init: int = 64,use_batch_norm: bool = True,dropout: float = 0.0,pool_kernel: int = 2,final_activation: Union[SupportedActivation, str] = SupportedActivation.NONE,n2v2: bool = False,independent_channels: bool = True,**... | 2 | 44 | 13 | 214 | 0 | 352 | 429 | 352 | self,conv_dim,in_channels,depth,num_channels_init,use_batch_norm,dropout,pool_kernel,n2v2,groups | [] | None | {"Assign": 5, "Expr": 4, "For": 1} | 9 | 62 | 9 | ["__init__", "super", "getattr", "MaxBlurPool", "range", "encoder_blocks.append", "Conv_Block", "encoder_blocks.append", "nn.ModuleList"] | 8,182 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15197461_googleapis_python_cloud_core.google.cloud._helpers.__init___py._LocalStack.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.AmountMissi... | The function (__init__) defined within the public class called UnetEncoder, that inherit another class.The function start at line 352 and ends at 429. It contains 44 lines of code and it has a cyclomatic complexity of 2. It takes 13 parameters, represented as [352.0] and does not return any value. It declares 9.0 funct... |
CAREamics_careamics | UnetEncoder | public | 0 | 1 | forward | def forward(self, x: torch.Tensor) -> torch.Tensor:"""Forward pass.Parameters----------x :torch.TensorInput tensor.Returns-------torch.TensorOutput of the model."""encoder_features = self.encoder(x)x = self.decoder(*encoder_features)x = self.final_conv(x)x = self.final_activation(x)return x | 1 | 6 | 2 | 51 | 0 | 431 | 449 | 431 | self,x | [] | list[torch.Tensor] | {"Assign": 3, "Expr": 2, "For": 1, "If": 1, "Return": 1} | 3 | 22 | 3 | ["module", "isinstance", "encoder_features.append"] | 54 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3646986_mapbox_mapbox_sdk_py.tests.test_geocoder_py.test_geocoder_forward", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3646986_mapbox_mapbox_sdk_py.tests.test_geocoder_py.test_geocoder_forward_bbox", "_.content.g... | The function (forward) defined within the public class called UnetEncoder, that inherit another class.The function start at line 431 and ends at 449. It contains 6 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [431.0] and does not return any value. It declares 3.0 function... |
CAREamics_careamics | ResidualBlock | public | 0 | 1 | __init__ | def __init__(self,channels: int,nonlin: Callable,conv_strides: tuple[int] = (2, 2),kernel: Union[int, Iterable[int], None] = None,groups: int = 1,batchnorm: bool = True,block_type: str = None,dropout: float = None,gated: bool = None,conv2d_bias: bool = True,):"""Constructor.Parameters----------channels: intThe number o... | 18 | 86 | 5 | 466 | 0 | 46 | 168 | 46 | self,channels,nonlin,conv_strides,kernel,groups,batchnorm,block_type,dropout,gated,conv2d_bias | [] | None | {"AnnAssign": 3, "Assign": 9, "Expr": 15, "For": 3, "If": 12} | 41 | 123 | 41 | ["__init__", "super", "isinstance", "len", "ValueError", "all", "list", "getattr", "len", "getattr", "len", "getattr", "len", "range", "conv_layer", "modules.append", "modules.append", "modules.append", "norm_layer", "modules.append", "dropout_layer", "range", "modules.append", "norm_layer", "modules.append", "conv_lay... | 8,182 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15197461_googleapis_python_cloud_core.google.cloud._helpers.__init___py._LocalStack.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.AmountMissi... | The function (__init__) defined within the public class called ResidualBlock, that inherit another class.The function start at line 46 and ends at 168. It contains 86 lines of code and it has a cyclomatic complexity of 18. It takes 5 parameters, represented as [46.0] and does not return any value. It declares 41.0 func... |
CAREamics_careamics | ResidualBlock | public | 0 | 1 | forward | def forward(self, x: torch.Tensor) -> torch.Tensor:"""Forward pass.Parameters----------x : torch.Tensorinput tensor # TODO add shapeReturns-------torch.Tensoroutput tensor # TODO add shape"""out = self.block(x)assert (out.shape == x.shape), f"output shape: {out.shape} != input shape: {x.shape}"return out + x | 1 | 6 | 2 | 41 | 0 | 170 | 187 | 170 | self,x | [] | torch.Tensor | {"Assign": 1, "Expr": 1, "Return": 1} | 1 | 18 | 1 | ["self.block"] | 54 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3646986_mapbox_mapbox_sdk_py.tests.test_geocoder_py.test_geocoder_forward", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3646986_mapbox_mapbox_sdk_py.tests.test_geocoder_py.test_geocoder_forward_bbox", "_.content.g... | The function (forward) defined within the public class called ResidualBlock, that inherit another class.The function start at line 170 and ends at 187. It contains 6 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [170.0] and does not return any value. It declare 1.0 functio... |
CAREamics_careamics | ResidualBlock | public | 0 | 1 | __init__ | def __init__(self, *args, **kwargs):super().__init__(*args, **kwargs, gated=True) | 1 | 2 | 3 | 27 | 0 | 193 | 194 | 193 | self,channels,nonlin,conv_strides,kernel,groups,batchnorm,block_type,dropout,gated,conv2d_bias | [] | None | {"AnnAssign": 3, "Assign": 9, "Expr": 15, "For": 3, "If": 12} | 41 | 123 | 41 | ["__init__", "super", "isinstance", "len", "ValueError", "all", "list", "getattr", "len", "getattr", "len", "getattr", "len", "range", "conv_layer", "modules.append", "modules.append", "modules.append", "norm_layer", "modules.append", "dropout_layer", "range", "modules.append", "norm_layer", "modules.append", "conv_lay... | 8,182 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15197461_googleapis_python_cloud_core.google.cloud._helpers.__init___py._LocalStack.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.AmountMissi... | The function (__init__) defined within the public class called ResidualBlock, that inherit another class.The function start at line 193 and ends at 194. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [193.0] and does not return any value. It declares 41.0 func... |
CAREamics_careamics | ResidualBlock | public | 0 | 1 | __init__ | def __init__(self,channels: int,conv_strides: tuple[int] = (2, 2),kernel_size: int = 3,nonlin: Callable = nn.LeakyReLU(),):super().__init__()assert kernel_size % 2 == 1pad = kernel_size // 2conv_layer: ConvType = getattr(nn, f"Conv{len(conv_strides)}d")self.conv = conv_layer(channels, 2 * channels, kernel_size, padding... | 1 | 13 | 4 | 90 | 0 | 205 | 217 | 205 | self,channels,nonlin,conv_strides,kernel,groups,batchnorm,block_type,dropout,gated,conv2d_bias | [] | None | {"AnnAssign": 3, "Assign": 9, "Expr": 15, "For": 3, "If": 12} | 41 | 123 | 41 | ["__init__", "super", "isinstance", "len", "ValueError", "all", "list", "getattr", "len", "getattr", "len", "getattr", "len", "range", "conv_layer", "modules.append", "modules.append", "modules.append", "norm_layer", "modules.append", "dropout_layer", "range", "modules.append", "norm_layer", "modules.append", "conv_lay... | 8,182 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15197461_googleapis_python_cloud_core.google.cloud._helpers.__init___py._LocalStack.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.AmountMissi... | The function (__init__) defined within the public class called ResidualBlock, that inherit another class.The function start at line 205 and ends at 217. It contains 13 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [205.0] and does not return any value. It declares 41.0 fun... |
CAREamics_careamics | ResidualBlock | public | 0 | 1 | forward | def forward(self, x: torch.Tensor) -> torch.Tensor:"""Forward pass.Parameters----------x : torch.Tensorinput # TODO add shapeReturns-------torch.Tensoroutput # TODO add shape"""x = self.conv(x)x, gate = torch.chunk(x, 2, dim=1)x = self.nonlin(x)# TODO remove this?gate = torch.sigmoid(gate)return x * gate | 1 | 6 | 2 | 60 | 0 | 219 | 236 | 219 | self,x | [] | torch.Tensor | {"Assign": 1, "Expr": 1, "Return": 1} | 1 | 18 | 1 | ["self.block"] | 54 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3646986_mapbox_mapbox_sdk_py.tests.test_geocoder_py.test_geocoder_forward", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3646986_mapbox_mapbox_sdk_py.tests.test_geocoder_py.test_geocoder_forward_bbox", "_.content.g... | The function (forward) defined within the public class called ResidualBlock, that inherit another class.The function start at line 219 and ends at 236. It contains 6 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [219.0] and does not return any value. It declare 1.0 functio... |
CAREamics_careamics | ResidualBlock | public | 0 | 1 | __init__ | def __init__(self,mode: Literal["top-down", "bottom-up"],c_in: int,c_out: int,conv_strides: tuple[int],min_inner_channels: Union[int, None] = None,nonlin: Callable = nn.LeakyReLU(),resample: bool = False,res_block_kernel: Optional[Union[int, Iterable[int]]] = None,groups: int = 1,batchnorm: bool = True,res_block_type: ... | 8 | 70 | 7 | 392 | 0 | 258 | 380 | 258 | self,channels,nonlin,conv_strides,kernel,groups,batchnorm,block_type,dropout,gated,conv2d_bias | [] | None | {"AnnAssign": 3, "Assign": 9, "Expr": 15, "For": 3, "If": 12} | 41 | 123 | 41 | ["__init__", "super", "isinstance", "len", "ValueError", "all", "list", "getattr", "len", "getattr", "len", "getattr", "len", "range", "conv_layer", "modules.append", "modules.append", "modules.append", "norm_layer", "modules.append", "dropout_layer", "range", "modules.append", "norm_layer", "modules.append", "conv_lay... | 8,182 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15197461_googleapis_python_cloud_core.google.cloud._helpers.__init___py._LocalStack.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.AmountMissi... | The function (__init__) defined within the public class called ResidualBlock, that inherit another class.The function start at line 258 and ends at 380. It contains 70 lines of code and it has a cyclomatic complexity of 8. It takes 7 parameters, represented as [258.0] and does not return any value. It declares 41.0 fun... |
CAREamics_careamics | ResidualBlock | public | 0 | 1 | forward | def forward(self, x: torch.Tensor) -> torch.Tensor:"""Forward pass.Parameters----------x : torch.Tensorinput # TODO add shapeReturns-------torch.Tensoroutput # TODO add shape"""if self.pre_conv is not None:x = self.pre_conv(x)x = self.res(x)if self.post_conv is not None:x = self.post_conv(x)return x | 3 | 7 | 2 | 58 | 0 | 382 | 402 | 382 | self,x | [] | torch.Tensor | {"Assign": 1, "Expr": 1, "Return": 1} | 1 | 18 | 1 | ["self.block"] | 54 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3646986_mapbox_mapbox_sdk_py.tests.test_geocoder_py.test_geocoder_forward", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3646986_mapbox_mapbox_sdk_py.tests.test_geocoder_py.test_geocoder_forward_bbox", "_.content.g... | The function (forward) defined within the public class called ResidualBlock, that inherit another class.The function start at line 382 and ends at 402. It contains 7 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [382.0] and does not return any value. It declare 1.0 functio... |
CAREamics_careamics | ResidualBlock | public | 0 | 1 | __init__ | def __init__(self, *args, upsample: bool = False, **kwargs):kwargs["resample"] = upsamplesuper().__init__("top-down", *args, **kwargs) | 1 | 3 | 4 | 37 | 0 | 408 | 410 | 408 | self,channels,nonlin,conv_strides,kernel,groups,batchnorm,block_type,dropout,gated,conv2d_bias | [] | None | {"AnnAssign": 3, "Assign": 9, "Expr": 15, "For": 3, "If": 12} | 41 | 123 | 41 | ["__init__", "super", "isinstance", "len", "ValueError", "all", "list", "getattr", "len", "getattr", "len", "getattr", "len", "range", "conv_layer", "modules.append", "modules.append", "modules.append", "norm_layer", "modules.append", "dropout_layer", "range", "modules.append", "norm_layer", "modules.append", "conv_lay... | 8,182 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15197461_googleapis_python_cloud_core.google.cloud._helpers.__init___py._LocalStack.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.AmountMissi... | The function (__init__) defined within the public class called ResidualBlock, that inherit another class.The function start at line 408 and ends at 410. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [408.0] and does not return any value. It declares 41.0 func... |
CAREamics_careamics | ResidualBlock | public | 0 | 1 | __init__ | def __init__(self, *args, upsample: bool = False, **kwargs):kwargs["resample"] = upsamplesuper().__init__("top-down", *args, **kwargs) | 1 | 3 | 4 | 37 | 0 | 416 | 418 | 408 | self,channels,nonlin,conv_strides,kernel,groups,batchnorm,block_type,dropout,gated,conv2d_bias | [] | None | {"AnnAssign": 3, "Assign": 9, "Expr": 15, "For": 3, "If": 12} | 41 | 123 | 41 | ["__init__", "super", "isinstance", "len", "ValueError", "all", "list", "getattr", "len", "getattr", "len", "getattr", "len", "range", "conv_layer", "modules.append", "modules.append", "modules.append", "norm_layer", "modules.append", "dropout_layer", "range", "modules.append", "norm_layer", "modules.append", "conv_lay... | 8,182 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15197461_googleapis_python_cloud_core.google.cloud._helpers.__init___py._LocalStack.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.AmountMissi... | The function (__init__) defined within the public class called ResidualBlock, that inherit another class.The function start at line 416 and ends at 418. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [408.0] and does not return any value. It declares 41.0 func... |
CAREamics_careamics | ResidualBlock | public | 0 | 1 | __init__ | def __init__(self,n_res_blocks: int,n_filters: int,conv_strides: tuple[int] = (2, 2),downsampling_steps: int = 0,nonlin: Optional[Callable] = None,batchnorm: bool = True,dropout: Optional[float] = None,res_block_type: Optional[str] = None,res_block_kernel: Optional[int] = None,gated: Optional[bool] = None,enable_multis... | 6 | 62 | 5 | 336 | 0 | 439 | 553 | 439 | self,channels,nonlin,conv_strides,kernel,groups,batchnorm,block_type,dropout,gated,conv2d_bias | [] | None | {"AnnAssign": 3, "Assign": 9, "Expr": 15, "For": 3, "If": 12} | 41 | 123 | 41 | ["__init__", "super", "isinstance", "len", "ValueError", "all", "list", "getattr", "len", "getattr", "len", "getattr", "len", "range", "conv_layer", "modules.append", "modules.append", "modules.append", "norm_layer", "modules.append", "dropout_layer", "range", "modules.append", "norm_layer", "modules.append", "conv_lay... | 8,182 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15197461_googleapis_python_cloud_core.google.cloud._helpers.__init___py._LocalStack.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.AmountMissi... | The function (__init__) defined within the public class called ResidualBlock, that inherit another class.The function start at line 439 and ends at 553. It contains 62 lines of code and it has a cyclomatic complexity of 6. It takes 5 parameters, represented as [439.0] and does not return any value. It declares 41.0 fun... |
CAREamics_careamics | BottomUpLayer | public | 0 | 1 | _init_multiscale | def _init_multiscale(self,nonlin: Callable = None,n_filters: int = None,conv_strides: tuple[int] = (2, 2),batchnorm: bool = None,dropout: float = None,res_block_type: str = None,) -> None:"""Bottom-up layer's method that initializes the LC modules.Defines the modules responsible of merging compressed lateral inputs to ... | 2 | 23 | 5 | 121 | 0 | 560 | 614 | 560 | self,nonlin,n_filters,conv_strides,batchnorm,dropout,res_block_type | [] | None | {"Assign": 3, "Expr": 1, "If": 1} | 2 | 55 | 2 | ["deepcopy", "MergeLowRes"] | 0 | [] | The function (_init_multiscale) defined within the public class called BottomUpLayer, that inherit another class.The function start at line 560 and ends at 614. It contains 23 lines of code and it has a cyclomatic complexity of 2. It takes 5 parameters, represented as [560.0] and does not return any value. It declares ... |
CAREamics_careamics | ResidualBlock | public | 0 | 1 | forward | def forward(self, x: torch.Tensor, lowres_x: Union[torch.Tensor, None] = None) -> tuple[torch.Tensor, torch.Tensor]:"""Forward pass.Parameters----------x: torch.TensorThe input of the `BottomUpLayer`, i.e., the input image or the output of theprevious layer.lowres_x: torch.Tensor, optionalThe low-res input used for Lat... | 6 | 26 | 3 | 169 | 0 | 616 | 678 | 616 | self,x | [] | torch.Tensor | {"Assign": 1, "Expr": 1, "Return": 1} | 1 | 18 | 1 | ["self.block"] | 54 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3646986_mapbox_mapbox_sdk_py.tests.test_geocoder_py.test_geocoder_forward", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3646986_mapbox_mapbox_sdk_py.tests.test_geocoder_py.test_geocoder_forward_bbox", "_.content.g... | The function (forward) defined within the public class called ResidualBlock, that inherit another class.The function start at line 616 and ends at 678. It contains 26 lines of code and it has a cyclomatic complexity of 6. It takes 3 parameters, represented as [616.0] and does not return any value. It declare 1.0 functi... |
CAREamics_careamics | ResidualBlock | public | 0 | 1 | __init__ | def __init__(self,merge_type: Literal["linear", "residual", "residual_ungated"],channels: Union[int, Iterable[int]],conv_strides: tuple[int] = (2, 2),nonlin: Callable = nn.LeakyReLU(),batchnorm: bool = True,dropout: Optional[float] = None,res_block_type: Optional[str] = None,res_block_kernel: Optional[int] = None,conv2... | 6 | 57 | 5 | 356 | 0 | 692 | 790 | 692 | self,channels,nonlin,conv_strides,kernel,groups,batchnorm,block_type,dropout,gated,conv2d_bias | [] | None | {"AnnAssign": 3, "Assign": 9, "Expr": 15, "For": 3, "If": 12} | 41 | 123 | 41 | ["__init__", "super", "isinstance", "len", "ValueError", "all", "list", "getattr", "len", "getattr", "len", "getattr", "len", "range", "conv_layer", "modules.append", "modules.append", "modules.append", "norm_layer", "modules.append", "dropout_layer", "range", "modules.append", "norm_layer", "modules.append", "conv_lay... | 8,182 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15197461_googleapis_python_cloud_core.google.cloud._helpers.__init___py._LocalStack.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.AmountMissi... | The function (__init__) defined within the public class called ResidualBlock, that inherit another class.The function start at line 692 and ends at 790. It contains 57 lines of code and it has a cyclomatic complexity of 6. It takes 5 parameters, represented as [692.0] and does not return any value. It declares 41.0 fun... |
CAREamics_careamics | ResidualBlock | public | 0 | 1 | forward | def forward(self, *args) -> torch.Tensor:# Concatenate the input tensors along dim=1x = torch.cat(args, dim=1)# Pass the concatenated tensor through the conv layerx = self.layer(x)return x | 1 | 4 | 2 | 34 | 0 | 792 | 800 | 792 | self,x | [] | torch.Tensor | {"Assign": 1, "Expr": 1, "Return": 1} | 1 | 18 | 1 | ["self.block"] | 54 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3646986_mapbox_mapbox_sdk_py.tests.test_geocoder_py.test_geocoder_forward", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3646986_mapbox_mapbox_sdk_py.tests.test_geocoder_py.test_geocoder_forward_bbox", "_.content.g... | The function (forward) defined within the public class called ResidualBlock, that inherit another class.The function start at line 792 and ends at 800. It contains 4 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [792.0] and does not return any value. It declare 1.0 functio... |
CAREamics_careamics | ResidualBlock | public | 0 | 1 | __init__ | def __init__(self, *args, **kwargs):self.retain_spatial_dims = kwargs.pop("multiscale_retain_spatial_dims")self.multiscale_lowres_size_factor = kwargs.pop("multiscale_lowres_size_factor")super().__init__(*args, **kwargs) | 1 | 4 | 3 | 43 | 0 | 811 | 814 | 811 | self,channels,nonlin,conv_strides,kernel,groups,batchnorm,block_type,dropout,gated,conv2d_bias | [] | None | {"AnnAssign": 3, "Assign": 9, "Expr": 15, "For": 3, "If": 12} | 41 | 123 | 41 | ["__init__", "super", "isinstance", "len", "ValueError", "all", "list", "getattr", "len", "getattr", "len", "getattr", "len", "range", "conv_layer", "modules.append", "modules.append", "modules.append", "norm_layer", "modules.append", "dropout_layer", "range", "modules.append", "norm_layer", "modules.append", "conv_lay... | 8,182 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15197461_googleapis_python_cloud_core.google.cloud._helpers.__init___py._LocalStack.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.AmountMissi... | The function (__init__) defined within the public class called ResidualBlock, that inherit another class.The function start at line 811 and ends at 814. It contains 4 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [811.0] and does not return any value. It declares 41.0 func... |
CAREamics_careamics | ResidualBlock | public | 0 | 1 | forward | def forward(self, latent: torch.Tensor, lowres: torch.Tensor) -> torch.Tensor:"""Forward pass.Parameters----------latent: torch.TensorThe output latent tensor from previous layer in the LVAE hierarchy.lowres: torch.TensorThe low-res patch image to be merged to increase the context."""# TODO: treat (X, Y) and Z differen... | 2 | 13 | 3 | 126 | 0 | 816 | 843 | 816 | self,x | [] | torch.Tensor | {"Assign": 1, "Expr": 1, "Return": 1} | 1 | 18 | 1 | ["self.block"] | 54 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3646986_mapbox_mapbox_sdk_py.tests.test_geocoder_py.test_geocoder_forward", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3646986_mapbox_mapbox_sdk_py.tests.test_geocoder_py.test_geocoder_forward_bbox", "_.content.g... | The function (forward) defined within the public class called ResidualBlock, that inherit another class.The function start at line 816 and ends at 843. It contains 13 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [816.0] and does not return any value. It declare 1.0 functi... |
CAREamics_careamics | ResidualBlock | public | 0 | 1 | __init__ | def __init__(self,nonlin: Callable,channels: Union[int, Iterable[int]],batchnorm: bool,dropout: float,res_block_type: str,conv_strides: tuple[int] = (2, 2),merge_type: Literal["linear", "residual", "residual_ungated"] = "residual",conv2d_bias: bool = True,res_block_kernel: Optional[int] = None,):"""Constructor.nonlin: ... | 1 | 23 | 8 | 119 | 0 | 849 | 903 | 849 | self,channels,nonlin,conv_strides,kernel,groups,batchnorm,block_type,dropout,gated,conv2d_bias | [] | None | {"AnnAssign": 3, "Assign": 9, "Expr": 15, "For": 3, "If": 12} | 41 | 123 | 41 | ["__init__", "super", "isinstance", "len", "ValueError", "all", "list", "getattr", "len", "getattr", "len", "getattr", "len", "range", "conv_layer", "modules.append", "modules.append", "modules.append", "norm_layer", "modules.append", "dropout_layer", "range", "modules.append", "norm_layer", "modules.append", "conv_lay... | 8,182 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15197461_googleapis_python_cloud_core.google.cloud._helpers.__init___py._LocalStack.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.AmountMissi... | The function (__init__) defined within the public class called ResidualBlock, that inherit another class.The function start at line 849 and ends at 903. It contains 23 lines of code and it has a cyclomatic complexity of 1. It takes 8 parameters, represented as [849.0] and does not return any value. It declares 41.0 fun... |
CAREamics_careamics | ResidualBlock | public | 0 | 1 | __init__ | def __init__(self,z_dim: int,n_res_blocks: int,n_filters: int,conv_strides: tuple[int],is_top_layer: bool = False,upsampling_steps: Union[int, None] = None,nonlin: Union[Callable, None] = None,merge_type: Union[Literal["linear", "residual", "residual_ungated"], None] = None,batchnorm: bool = True,dropout: Union[float, ... | 8 | 103 | 29 | 548 | 0 | 943 | 1,143 | 943 | self,channels,nonlin,conv_strides,kernel,groups,batchnorm,block_type,dropout,gated,conv2d_bias | [] | None | {"AnnAssign": 3, "Assign": 9, "Expr": 15, "For": 3, "If": 12} | 41 | 123 | 41 | ["__init__", "super", "isinstance", "len", "ValueError", "all", "list", "getattr", "len", "getattr", "len", "getattr", "len", "range", "conv_layer", "modules.append", "modules.append", "modules.append", "norm_layer", "modules.append", "dropout_layer", "range", "modules.append", "norm_layer", "modules.append", "conv_lay... | 8,182 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15197461_googleapis_python_cloud_core.google.cloud._helpers.__init___py._LocalStack.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.AmountMissi... | The function (__init__) defined within the public class called ResidualBlock, that inherit another class.The function start at line 943 and ends at 1143. It contains 103 lines of code and it has a cyclomatic complexity of 8. It takes 29 parameters, represented as [943.0] and does not return any value. It declares 41.0 ... |
CAREamics_careamics | TopDownLayer | public | 0 | 1 | sample_from_q | def sample_from_q(self,input_: torch.Tensor,bu_value: torch.Tensor,var_clip_max: Optional[float] = None,mask: torch.Tensor = None,) -> torch.Tensor:"""Method computes the latent inference distribution q(z_i|z_{i+1}).Used for sampling a latent tensor from it.Parameters----------input_: torch.TensorThe input tensor to th... | 3 | 17 | 5 | 95 | 0 | 1,145 | 1,183 | 1,145 | self,input_,bu_value,var_clip_max,mask | [] | torch.Tensor | {"Assign": 5, "Expr": 1, "If": 2, "Return": 2} | 3 | 39 | 3 | ["self.get_p_params", "self.merge", "self.stochastic.sample_from_q"] | 0 | [] | The function (sample_from_q) defined within the public class called TopDownLayer, that inherit another class.The function start at line 1145 and ends at 1183. It contains 17 lines of code and it has a cyclomatic complexity of 3. It takes 5 parameters, represented as [1145.0] and does not return any value. It declares 3... |
CAREamics_careamics | TopDownLayer | public | 0 | 1 | get_p_params | def get_p_params(self,input_: torch.Tensor,n_img_prior: int,) -> torch.Tensor:"""Return the parameters of the prior distribution p(z_i|z_{i+1}).The parameters depend on the hierarchical level of the layer:- if it is the topmost level, parameters are the ones of the prior.- else, the input from the layer above is the pa... | 3 | 13 | 3 | 64 | 0 | 1,185 | 1,217 | 1,185 | self,input_,n_img_prior | [] | torch.Tensor | {"Assign": 4, "Expr": 1, "If": 2, "Return": 1} | 1 | 33 | 1 | ["p_params.expand"] | 0 | [] | The function (get_p_params) defined within the public class called TopDownLayer, that inherit another class.The function start at line 1185 and ends at 1217. It contains 13 lines of code and it has a cyclomatic complexity of 3. It takes 3 parameters, represented as [1185.0] and does not return any value. It declare 1.0... |
CAREamics_careamics | ResidualBlock | public | 0 | 1 | forward | def forward(self,input_: Union[torch.Tensor, None] = None,skip_connection_input: Union[torch.Tensor, None] = None,inference_mode: bool = False,bu_value: Union[torch.Tensor, None] = None,n_img_prior: Union[int, None] = None,forced_latent: Union[torch.Tensor, None] = None,force_constant_output: bool = False,mode_pred: bo... | 16 | 77 | 11 | 483 | 0 | 1,219 | 1,371 | 1,219 | self,x | [] | torch.Tensor | {"Assign": 1, "Expr": 1, "Return": 1} | 1 | 18 | 1 | ["self.block"] | 54 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3646986_mapbox_mapbox_sdk_py.tests.test_geocoder_py.test_geocoder_forward", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3646986_mapbox_mapbox_sdk_py.tests.test_geocoder_py.test_geocoder_forward_bbox", "_.content.g... | The function (forward) defined within the public class called ResidualBlock, that inherit another class.The function start at line 1219 and ends at 1371. It contains 77 lines of code and it has a cyclomatic complexity of 16. It takes 11 parameters, represented as [1219.0] and does not return any value. It declare 1.0 f... |
CAREamics_careamics | public | public | 0 | 0 | likelihood_factory | def likelihood_factory(config: Optional[Union[GaussianLikelihoodConfig, NMLikelihoodConfig]],noise_model: Optional[NoiseModel] = None,):"""Factory function for creating likelihood modules.Parameters----------config: Union[GaussianLikelihoodConfig, NMLikelihoodConfig]The configuration object for the likelihood module.no... | 4 | 15 | 2 | 73 | 0 | 28 | 58 | 28 | config,noise_model | [] | Returns | {"Expr": 1, "If": 3, "Return": 3} | 4 | 31 | 4 | ["isinstance", "GaussianLikelihood", "isinstance", "NoiseModelLikelihood"] | 8 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.lightning.lightning_module_py.VAEModule.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.tests.likelihood_modules.test_likelihoods_py.t... | The function (likelihood_factory) defined within the public class called public.The function start at line 28 and ends at 58. It contains 15 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [28.0], and this function return a value. It declares 4.0 functions, It has 4.0 functi... |
CAREamics_careamics | LikelihoodModule | public | 0 | 1 | distr_params | def distr_params(self, x: Any) -> None:return None | 1 | 2 | 2 | 13 | 0 | 68 | 69 | 68 | self,x | [] | None | {"Return": 1} | 0 | 2 | 0 | [] | 0 | [] | The function (distr_params) defined within the public class called LikelihoodModule, that inherit another class.The function start at line 68 and ends at 69. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [68.0] and does not return any value.. |
CAREamics_careamics | LikelihoodModule | public | 0 | 1 | set_params_to_same_device_as | def set_params_to_same_device_as(self, correct_device_tensor: Any) -> None:pass | 1 | 2 | 2 | 12 | 0 | 71 | 72 | 71 | self,correct_device_tensor | [] | None | {} | 0 | 2 | 0 | [] | 0 | [] | The function (set_params_to_same_device_as) defined within the public class called LikelihoodModule, that inherit another class.The function start at line 71 and ends at 72. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [71.0] and does not return any value.. |
CAREamics_careamics | LikelihoodModule | public | 0 | 1 | logvar | def logvar(params: Any) -> None:return None | 1 | 2 | 1 | 11 | 0 | 75 | 76 | 75 | params | [] | None | {"Return": 1} | 0 | 2 | 0 | [] | 0 | [] | The function (logvar) defined within the public class called LikelihoodModule, that inherit another class.The function start at line 75 and ends at 76. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
CAREamics_careamics | LikelihoodModule | public | 0 | 1 | mean | def mean(params: Any) -> None:return None | 1 | 2 | 1 | 11 | 0 | 79 | 80 | 79 | params | [] | None | {"Return": 1} | 0 | 2 | 0 | [] | 144 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3486992_kelvins_algoritmos_e_estruturas_de_dados.src.python.genetic_algorithm_py.GeneticAlgorithm.run", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3535398_idsia_brainstorm.brainstorm.hooks_py.MonitorLayerParamete... | The function (mean) defined within the public class called LikelihoodModule, that inherit another class.The function start at line 79 and ends at 80. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It has 144.0 functions calli... |
CAREamics_careamics | LikelihoodModule | public | 0 | 1 | mode | def mode(params: Any) -> None:return None | 1 | 2 | 1 | 11 | 0 | 83 | 84 | 83 | params | [] | None | {"Return": 1} | 0 | 2 | 0 | [] | 8 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3950162_vpelletier_python_libusb1.examples.hotplug_advanced_py.main", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.56769247_dmwm_cmsspark.src.python.CMSSpark.dbs_hdfs_eos_py.generate_parquet", "_.content.gdrive.MyD... | The function (mode) defined within the public class called LikelihoodModule, that inherit another class.The function start at line 83 and ends at 84. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It has 8.0 functions calling... |
CAREamics_careamics | LikelihoodModule | public | 0 | 1 | sample | def sample(params: Any) -> None:return None | 1 | 2 | 1 | 11 | 0 | 87 | 88 | 87 | params | [] | None | {"Return": 1} | 0 | 2 | 0 | [] | 67 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3659638_climbsrocks_auto_ml.auto_ml.utils_data_cleaning_py.BasicDataCleaning.fit", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3660028_openprocurement_openprocurement_auction.openprocurement.auction.helpers.couch_... | The function (sample) defined within the public class called LikelihoodModule, that inherit another class.The function start at line 87 and ends at 88. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It has 67.0 functions call... |
CAREamics_careamics | LikelihoodModule | public | 0 | 1 | log_likelihood | def log_likelihood(self, x: Any, params: Any) -> None:return None | 1 | 2 | 3 | 17 | 0 | 90 | 91 | 90 | self,x,params | [] | None | {"Return": 1} | 0 | 2 | 0 | [] | 0 | [] | The function (log_likelihood) defined within the public class called LikelihoodModule, that inherit another class.The function start at line 90 and ends at 91. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [90.0] and does not return any value.. |
CAREamics_careamics | LikelihoodModule | public | 0 | 1 | forward | def forward(self, input_: torch.Tensor, x: Union[torch.Tensor, None]) -> tuple[torch.Tensor, dict[str, torch.Tensor]]:"""Parameters----------input_: torch.TensorThe output of the top-down pass (e.g., reconstructed image in HDN,or the unmixed images in 'Split' models).x: Union[torch.Tensor, None]The target tensor. If No... | 2 | 20 | 3 | 127 | 0 | 97 | 128 | 97 | self,input_,x | [] | tuple[torch.Tensor, dict[str, torch.Tensor]] | {"Assign": 8, "Expr": 1, "If": 1, "Return": 1} | 6 | 32 | 6 | ["self.distr_params", "self.mean", "self.mode", "self.sample", "self.logvar", "self.log_likelihood"] | 54 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3646986_mapbox_mapbox_sdk_py.tests.test_geocoder_py.test_geocoder_forward", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3646986_mapbox_mapbox_sdk_py.tests.test_geocoder_py.test_geocoder_forward_bbox", "_.content.g... | The function (forward) defined within the public class called LikelihoodModule, that inherit another class.The function start at line 97 and ends at 128. It contains 20 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [97.0] and does not return any value. It declares 6.0 func... |
CAREamics_careamics | GaussianLikelihood | public | 0 | 1 | __init__ | def __init__(self,predict_logvar: Union[Literal["pixelwise"], None] = None,logvar_lowerbound: Union[float, None] = None,):"""Constructor.Parameters----------predict_logvar: Union[Literal["pixelwise"], None], optionalIf `pixelwise`, log-variance is computed for each pixel, else log-varianceis not computed. Default is `N... | 1 | 12 | 4 | 64 | 0 | 138 | 161 | 138 | self,predict_logvar,logvar_lowerbound | [] | None | {"Assign": 2, "Expr": 3} | 3 | 24 | 3 | ["__init__", "super", "print"] | 8,182 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15197461_googleapis_python_cloud_core.google.cloud._helpers.__init___py._LocalStack.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.AmountMissi... | The function (__init__) defined within the public class called GaussianLikelihood, that inherit another class.The function start at line 138 and ends at 161. It contains 12 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [138.0] and does not return any value. It declares 3.0... |
CAREamics_careamics | LikelihoodModule | public | 0 | 1 | get_mean_lv | def get_mean_lv(self, x: torch.Tensor) -> tuple[torch.Tensor, Optional[torch.Tensor]]:"""Given the output of the top-down pass, compute the mean and log-variance of theGaussian distribution defining the likelihood.Parameters----------x: torch.TensorThe input tensor to the likelihood module, i.e., the output of the top-... | 3 | 9 | 2 | 77 | 0 | 163 | 196 | 163 | self,x | [] | tuple[torch.Tensor, Optional[torch.Tensor]] | {"Expr": 1} | 0 | 3 | 0 | [] | 0 | [] | The function (get_mean_lv) defined within the public class called LikelihoodModule, that inherit another class.The function start at line 163 and ends at 196. It contains 9 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [163.0] and does not return any value.. |
CAREamics_careamics | LikelihoodModule | public | 0 | 1 | distr_params | def distr_params(self, x: torch.Tensor) -> dict[str, torch.Tensor]:"""Get parameters (mean, log-var) of the Gaussian distribution defined by the likelihood.Parameters----------x: torch.TensorThe input tensor to the likelihood module, i.e., the outputthe LVAE 'output_layer'. Shape is: (B, 2 * C, [Z], Y, X) in case`predi... | 1 | 7 | 2 | 45 | 0 | 198 | 214 | 198 | self,x | [] | None | {"Return": 1} | 0 | 2 | 0 | [] | 0 | [] | The function (distr_params) defined within the public class called LikelihoodModule, that inherit another class.The function start at line 198 and ends at 214. It contains 7 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [198.0] and does not return any value.. |
CAREamics_careamics | LikelihoodModule | public | 0 | 1 | mean | def mean(params: dict[str, torch.Tensor]) -> torch.Tensor:return params["mean"] | 1 | 2 | 1 | 23 | 0 | 217 | 218 | 217 | params | [] | None | {"Return": 1} | 0 | 2 | 0 | [] | 144 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3486992_kelvins_algoritmos_e_estruturas_de_dados.src.python.genetic_algorithm_py.GeneticAlgorithm.run", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3535398_idsia_brainstorm.brainstorm.hooks_py.MonitorLayerParamete... | The function (mean) defined within the public class called LikelihoodModule, that inherit another class.The function start at line 217 and ends at 218. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It has 144.0 functions cal... |
CAREamics_careamics | LikelihoodModule | public | 0 | 1 | mode | def mode(params: dict[str, torch.Tensor]) -> torch.Tensor:return params["mean"] | 1 | 2 | 1 | 23 | 0 | 221 | 222 | 221 | params | [] | None | {"Return": 1} | 0 | 2 | 0 | [] | 8 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3950162_vpelletier_python_libusb1.examples.hotplug_advanced_py.main", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.56769247_dmwm_cmsspark.src.python.CMSSpark.dbs_hdfs_eos_py.generate_parquet", "_.content.gdrive.MyD... | The function (mode) defined within the public class called LikelihoodModule, that inherit another class.The function start at line 221 and ends at 222. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It has 8.0 functions calli... |
CAREamics_careamics | LikelihoodModule | public | 0 | 1 | sample | def sample(params: dict[str, torch.Tensor]) -> torch.Tensor:# p = Normal(params['mean'], (params['logvar'] / 2).exp())# return p.rsample()return params["mean"] | 1 | 2 | 1 | 23 | 0 | 225 | 228 | 225 | params | [] | None | {"Return": 1} | 0 | 2 | 0 | [] | 67 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3659638_climbsrocks_auto_ml.auto_ml.utils_data_cleaning_py.BasicDataCleaning.fit", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3660028_openprocurement_openprocurement_auction.openprocurement.auction.helpers.couch_... | The function (sample) defined within the public class called LikelihoodModule, that inherit another class.The function start at line 225 and ends at 228. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It has 67.0 functions ca... |
CAREamics_careamics | LikelihoodModule | public | 0 | 1 | logvar | def logvar(params: dict[str, torch.Tensor]) -> torch.Tensor:return params["logvar"] | 1 | 2 | 1 | 23 | 0 | 231 | 232 | 231 | params | [] | None | {"Return": 1} | 0 | 2 | 0 | [] | 0 | [] | The function (logvar) defined within the public class called LikelihoodModule, that inherit another class.The function start at line 231 and ends at 232. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
CAREamics_careamics | LikelihoodModule | public | 0 | 1 | log_likelihood | def log_likelihood(self, x: torch.Tensor, params: dict[str, Union[torch.Tensor, None]]):"""Compute Gaussian log-likelihoodParameters----------x: torch.TensorThe target tensor. Shape is (B, C, [Z], Y, X).params: dict[str, Union[torch.Tensor, None]]The tensors obtained by chunking the output of the top-down pass,here use... | 2 | 8 | 3 | 73 | 0 | 234 | 256 | 234 | self,x,params | [] | None | {"Return": 1} | 0 | 2 | 0 | [] | 0 | [] | The function (log_likelihood) defined within the public class called LikelihoodModule, that inherit another class.The function start at line 234 and ends at 256. It contains 8 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [234.0] and does not return any value.. |
CAREamics_careamics | public | public | 0 | 0 | log_normal | def log_normal(x: torch.Tensor, mean: torch.Tensor, logvar: torch.Tensor) -> torch.Tensor:"""Compute the log-probability at `x` of a Gaussian distributionwith parameters `(mean, exp(logvar))`.NOTE: In the case of LVAE, the log-likeihood formula becomes:\\mathbb{E}_{z_1\\sim{q_\\phi}}[\\log{p_\theta(x|z_1)}]=-\frac{1}{2... | 1 | 8 | 3 | 73 | 2 | 259 | 282 | 259 | x,mean,logvar | ['var', 'log_prob'] | torch.Tensor | {"Assign": 2, "Expr": 1, "Return": 1} | 3 | 24 | 3 | ["torch.exp", "log", "torch.tensor"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.models.lvae.likelihoods_py.GaussianLikelihood.log_likelihood"] | The function (log_normal) defined within the public class called public.The function start at line 259 and ends at 282. It contains 8 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [259.0] and does not return any value. It declares 3.0 functions, It has 3.0 functions called... |
CAREamics_careamics | GaussianLikelihood | public | 0 | 1 | __init__ | def __init__(self,noise_model: NoiseModel,):"""Constructor.Parameters----------noiseModel: NoiseModelThe noise model instance used to compute the likelihood."""super().__init__()self.data_mean = Noneself.data_std = Noneself.noiseModel = noise_model | 1 | 8 | 2 | 33 | 0 | 287 | 301 | 287 | self,predict_logvar,logvar_lowerbound | [] | None | {"Assign": 2, "Expr": 3} | 3 | 24 | 3 | ["__init__", "super", "print"] | 8,182 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15197461_googleapis_python_cloud_core.google.cloud._helpers.__init___py._LocalStack.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.AmountMissi... | The function (__init__) defined within the public class called GaussianLikelihood, that inherit another class.The function start at line 287 and ends at 301. It contains 8 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [287.0] and does not return any value. It declares 3.0 ... |
CAREamics_careamics | NoiseModelLikelihood | public | 0 | 1 | set_data_stats | def set_data_stats(self,data_mean: Union[np.ndarray, torch.Tensor],data_std: Union[np.ndarray, torch.Tensor],) -> None:"""Set the data mean and std for denormalization.# TODO check this !!Parameters----------data_mean : Union[np.ndarray, torch.Tensor]Mean values for each channel. Will be reshaped to (1, C, 1, 1, 1) for... | 1 | 7 | 3 | 67 | 0 | 303 | 319 | 303 | self,data_mean,data_std | [] | None | {"Assign": 2, "Expr": 1} | 2 | 17 | 2 | ["torch.as_tensor", "torch.as_tensor"] | 0 | [] | The function (set_data_stats) defined within the public class called NoiseModelLikelihood, that inherit another class.The function start at line 303 and ends at 319. It contains 7 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [303.0] and does not return any value. It decla... |
CAREamics_careamics | NoiseModelLikelihood | public | 0 | 1 | _set_params_to_same_device_as | def _set_params_to_same_device_as(self, correct_device_tensor: torch.Tensor) -> None:"""Set the parameters to the same device as the input tensor.Parameters----------correct_device_tensor: torch.TensorThe tensor whose device is used to set the parameters."""if (self.data_mean is not Noneand self.data_mean.device != cor... | 4 | 11 | 2 | 83 | 0 | 323 | 340 | 323 | self,correct_device_tensor | [] | None | {"Assign": 2, "Expr": 2, "If": 2} | 3 | 18 | 3 | ["self.data_mean.to", "self.data_std.to", "self.noiseModel.to_device"] | 0 | [] | The function (_set_params_to_same_device_as) defined within the public class called NoiseModelLikelihood, that inherit another class.The function start at line 323 and ends at 340. It contains 11 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [323.0] and does not return any... |
CAREamics_careamics | LikelihoodModule | public | 0 | 1 | get_mean_lv | def get_mean_lv(self, x: torch.Tensor) -> tuple[torch.Tensor, None]:return x, None | 1 | 2 | 2 | 24 | 0 | 342 | 343 | 342 | self,x | [] | tuple[torch.Tensor, Optional[torch.Tensor]] | {"Expr": 1} | 0 | 3 | 0 | [] | 0 | [] | The function (get_mean_lv) defined within the public class called LikelihoodModule, that inherit another class.The function start at line 342 and ends at 343. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [342.0] and does not return any value.. |
CAREamics_careamics | LikelihoodModule | public | 0 | 1 | distr_params | def distr_params(self, x: torch.Tensor) -> dict[str, torch.Tensor]:mean, lv = self.get_mean_lv(x)params = {"mean": mean,"logvar": lv,}return params | 1 | 7 | 2 | 44 | 0 | 345 | 351 | 345 | self,x | [] | None | {"Return": 1} | 0 | 2 | 0 | [] | 0 | [] | The function (distr_params) defined within the public class called LikelihoodModule, that inherit another class.The function start at line 345 and ends at 351. It contains 7 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [345.0] and does not return any value.. |
CAREamics_careamics | LikelihoodModule | public | 0 | 1 | mean | def mean(params: dict[str, torch.Tensor]) -> torch.Tensor:return params["mean"] | 1 | 2 | 1 | 23 | 0 | 354 | 355 | 217 | params | [] | None | {"Return": 1} | 0 | 2 | 0 | [] | 144 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3486992_kelvins_algoritmos_e_estruturas_de_dados.src.python.genetic_algorithm_py.GeneticAlgorithm.run", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3535398_idsia_brainstorm.brainstorm.hooks_py.MonitorLayerParamete... | The function (mean) defined within the public class called LikelihoodModule, that inherit another class.The function start at line 354 and ends at 355. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It has 144.0 functions cal... |
CAREamics_careamics | LikelihoodModule | public | 0 | 1 | mode | def mode(params: dict[str, torch.Tensor]) -> torch.Tensor:return params["mean"] | 1 | 2 | 1 | 23 | 0 | 358 | 359 | 221 | params | [] | None | {"Return": 1} | 0 | 2 | 0 | [] | 8 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3950162_vpelletier_python_libusb1.examples.hotplug_advanced_py.main", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.56769247_dmwm_cmsspark.src.python.CMSSpark.dbs_hdfs_eos_py.generate_parquet", "_.content.gdrive.MyD... | The function (mode) defined within the public class called LikelihoodModule, that inherit another class.The function start at line 358 and ends at 359. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It has 8.0 functions calli... |
CAREamics_careamics | LikelihoodModule | public | 0 | 1 | sample | def sample(params: dict[str, torch.Tensor]) -> torch.Tensor:# p = Normal(params['mean'], (params['logvar'] / 2).exp())# return p.rsample()return params["mean"] | 1 | 2 | 1 | 23 | 0 | 362 | 363 | 225 | params | [] | None | {"Return": 1} | 0 | 2 | 0 | [] | 67 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3659638_climbsrocks_auto_ml.auto_ml.utils_data_cleaning_py.BasicDataCleaning.fit", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3660028_openprocurement_openprocurement_auction.openprocurement.auction.helpers.couch_... | The function (sample) defined within the public class called LikelihoodModule, that inherit another class.The function start at line 362 and ends at 363. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It has 67.0 functions ca... |
CAREamics_careamics | LikelihoodModule | public | 0 | 1 | log_likelihood | def log_likelihood(self, x: torch.Tensor, params: dict[str, torch.Tensor]):"""Compute the log-likelihood given the parameters `params` obtainedfrom the reconstruction tensor and the target tensor `x`.Parameters----------x: torch.TensorThe target tensor. Shape is (B, C, [Z], Y, X).params: dict[str, Union[torch.Tensor, N... | 3 | 13 | 3 | 94 | 0 | 365 | 393 | 365 | self,x,params | [] | None | {"Return": 1} | 0 | 2 | 0 | [] | 0 | [] | The function (log_likelihood) defined within the public class called LikelihoodModule, that inherit another class.The function start at line 365 and ends at 393. It contains 13 lines of code and it has a cyclomatic complexity of 3. It takes 3 parameters, represented as [365.0] and does not return any value.. |
CAREamics_careamics | LadderVAE | public | 0 | 1 | __init__ | def __init__(self,input_shape: int,output_channels: int,multiscale_count: int,z_dims: list[int],encoder_n_filters: int,decoder_n_filters: int,encoder_conv_strides: list[int],decoder_conv_strides: list[int],encoder_dropout: float,decoder_dropout: float,nonlinearity: str,predict_logvar: bool,analytical_kl: bool,):super()... | 12 | 123 | 14 | 717 | 0 | 65 | 252 | 65 | self,input_shape,output_channels,multiscale_count,z_dims,encoder_n_filters,decoder_n_filters,encoder_conv_strides,decoder_conv_strides,encoder_dropout,decoder_dropout,nonlinearity,predict_logvar,analytical_kl | [] | None | {"Assign": 67, "AugAssign": 1, "Expr": 3, "If": 3} | 27 | 188 | 27 | ["__init__", "super", "len", "nn.Parameter", "torch.ones", "nn.Parameter", "torch.ones", "len", "len", "nn.ModuleList", "GateLayer", "range", "len", "np.power", "sum", "max", "len", "getattr", "len", "getattr", "len", "self.create_first_bottom_up", "self._init_multires", "self.create_bottom_up_layers", "self.create_top... | 8,182 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15197461_googleapis_python_cloud_core.google.cloud._helpers.__init___py._LocalStack.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.AmountMissi... | The function (__init__) defined within the public class called LadderVAE, that inherit another class.The function start at line 65 and ends at 252. It contains 123 lines of code and it has a cyclomatic complexity of 12. It takes 14 parameters, represented as [65.0] and does not return any value. It declares 27.0 functi... |
CAREamics_careamics | LadderVAE | public | 0 | 1 | create_first_bottom_up | def create_first_bottom_up(self,init_stride: int,num_res_blocks: int = 1,) -> nn.Sequential:"""Method creates the first bottom-up block of the Encoder.Its role is to perform a first image compression step.It is composed by a sequence of nn.Conv2d + non-linearity +BottomUpDeterministicResBlock (1 or more, default is 1).... | 3 | 33 | 3 | 154 | 0 | 267 | 317 | 267 | self,init_stride,num_res_blocks | [] | nn.Sequential | {"Assign": 3, "Expr": 2, "For": 1, "Return": 1} | 6 | 51 | 6 | ["get_activation", "self.encoder_conv_op", "range", "modules.append", "BottomUpDeterministicResBlock", "nn.Sequential"] | 0 | [] | The function (create_first_bottom_up) defined within the public class called LadderVAE, that inherit another class.The function start at line 267 and ends at 317. It contains 33 lines of code and it has a cyclomatic complexity of 3. It takes 3 parameters, represented as [267.0] and does not return any value. It declare... |
CAREamics_careamics | LadderVAE | public | 0 | 1 | create_bottom_up_layers | def create_bottom_up_layers(self, lowres_separate_branch: bool) -> nn.ModuleList:"""Method creates the stack of bottom-up layers of the Encoder.that are used to generate the so-called `bu_values`.NOTE:If `self._multiscale_count < self.n_layers`, then LC is done only in the first`self._multiscale_count` bottom-up layers... | 4 | 35 | 2 | 195 | 0 | 319 | 382 | 319 | self,lowres_separate_branch | [] | nn.ModuleList | {"Assign": 7, "AugAssign": 1, "Expr": 2, "For": 1, "If": 1, "Return": 1} | 6 | 64 | 6 | ["get_activation", "nn.ModuleList", "range", "int", "bottom_up_layers.append", "BottomUpLayer"] | 0 | [] | The function (create_bottom_up_layers) defined within the public class called LadderVAE, that inherit another class.The function start at line 319 and ends at 382. It contains 35 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [319.0] and does not return any value. It declar... |
CAREamics_careamics | LadderVAE | public | 0 | 1 | create_top_down_layers | def create_top_down_layers(self) -> nn.ModuleList:"""Method creates the stack of top-down layers of the Decoder.In these layer the `bu`_values` from the Encoder are merged with the `p_params` from the previous layerof the Decoder to get `q_params`. Then, a stochastic layer generates a sample from the latent distributio... | 4 | 39 | 1 | 242 | 0 | 384 | 448 | 384 | self | [] | nn.ModuleList | {"Assign": 5, "Expr": 2, "For": 1, "If": 1, "Return": 1} | 9 | 65 | 9 | ["nn.ModuleList", "get_activation", "range", "len", "np.sqrt", "top_down_layers.append", "TopDownLayer", "self.get_top_prior_param_shape", "self.get_latent_spatial_size"] | 0 | [] | The function (create_top_down_layers) defined within the public class called LadderVAE, that inherit another class.The function start at line 384 and ends at 448. It contains 39 lines of code and it has a cyclomatic complexity of 4. The function does not take any parameters and does not return any value. It declares 9.... |
CAREamics_careamics | LadderVAE | public | 0 | 1 | create_final_topdown_layer | def create_final_topdown_layer(self, upsample: bool) -> nn.Sequential:"""Create the final top-down layer of the Decoder.NOTE: In this layer, (optional) upsampling is performed by bilinear interpolationinstead of transposed convolution (like in other TD layers).Parameters----------upsample: boolWhether to upsample the i... | 3 | 20 | 2 | 122 | 0 | 450 | 483 | 450 | self,upsample | [] | nn.Sequential | {"Assign": 1, "Expr": 3, "For": 1, "If": 1, "Return": 1} | 8 | 34 | 8 | ["list", "modules.append", "Interpolate", "range", "modules.append", "TopDownDeterministicResBlock", "get_activation", "nn.Sequential"] | 0 | [] | The function (create_final_topdown_layer) defined within the public class called LadderVAE, that inherit another class.The function start at line 450 and ends at 483. It contains 20 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [450.0] and does not return any value. It dec... |
CAREamics_careamics | LadderVAE | public | 0 | 1 | _init_multires | def _init_multires(self, config=None) -> nn.ModuleList:"""Method defines the input block/branch to encode/compress low-res lateral inputs.at different hierarchical levelsin the multiresolution approach (LC). The role of the input branches is similarto the one of the first bottom-up layer in the primary flow of the Enco... | 6 | 44 | 2 | 206 | 0 | 485 | 552 | 485 | self,config | [] | nn.ModuleList | {"Assign": 8, "Expr": 2, "For": 1, "If": 1} | 8 | 68 | 8 | ["get_activation", "range", "nn.Sequential", "self.encoder_conv_op", "BottomUpDeterministicResBlock", "lowres_first_bottom_ups.append", "len", "nn.ModuleList"] | 0 | [] | The function (_init_multires) defined within the public class called LadderVAE, that inherit another class.The function start at line 485 and ends at 552. It contains 44 lines of code and it has a cyclomatic complexity of 6. It takes 2 parameters, represented as [485.0] and does not return any value. It declares 8.0 fu... |
CAREamics_careamics | LadderVAE | public | 0 | 1 | bottomup_pass | def bottomup_pass(self, inp: torch.Tensor) -> list[torch.Tensor]:"""Wrapper of _bottomup_pass()."""# TODO Remove wrapperreturn self._bottomup_pass(inp,self.first_bottom_up,self.lowres_first_bottom_ups,self.bottom_up_layers,) | 1 | 7 | 2 | 39 | 0 | 555 | 563 | 555 | self,inp | [] | list[torch.Tensor] | {"Expr": 1, "Return": 1} | 1 | 9 | 1 | ["self._bottomup_pass"] | 0 | [] | The function (bottomup_pass) defined within the public class called LadderVAE, that inherit another class.The function start at line 555 and ends at 563. It contains 7 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [555.0] and does not return any value. It declare 1.0 funct... |
CAREamics_careamics | LadderVAE | public | 0 | 1 | _bottomup_pass | def _bottomup_pass(self,inp: torch.Tensor,first_bottom_up: nn.Sequential,lowres_first_bottom_ups: nn.ModuleList,bottom_up_layers: nn.ModuleList,) -> list[torch.Tensor]:"""Method defines the forward pass through the LVAE Encoder, the so-called.Bottom-Up pass.Parameters----------inp: torch.TensorThe input tensor to the b... | 5 | 19 | 5 | 143 | 0 | 565 | 606 | 565 | self,inp,first_bottom_up,lowres_first_bottom_ups,bottom_up_layers | [] | list[torch.Tensor] | {"Assign": 6, "Expr": 2, "For": 1, "If": 2, "Return": 1} | 4 | 42 | 4 | ["first_bottom_up", "first_bottom_up", "range", "bu_values.append"] | 0 | [] | The function (_bottomup_pass) defined within the public class called LadderVAE, that inherit another class.The function start at line 565 and ends at 606. It contains 19 lines of code and it has a cyclomatic complexity of 5. It takes 5 parameters, represented as [565.0] and does not return any value. It declares 4.0 fu... |
CAREamics_careamics | LadderVAE | public | 0 | 1 | topdown_pass | def topdown_pass(self,bu_values: Union[torch.Tensor, None] = None,n_img_prior: Union[torch.Tensor, None] = None,constant_layers: Union[Iterable[int], None] = None,forced_latent: Union[list[torch.Tensor], None] = None,top_down_layers: Union[nn.ModuleList, None] = None,final_top_down_layer: Union[nn.Sequential, None] = N... | 10 | 78 | 9 | 479 | 0 | 608 | 747 | 608 | self,bu_values,n_img_prior,constant_layers,forced_latent,top_down_layers,final_top_down_layer | [] | tuple[torch.Tensor, dict[str, torch.Tensor]] | {"Assign": 32, "Expr": 1, "For": 1, "If": 6, "Return": 1, "Try": 1} | 6 | 140 | 6 | ["len", "RuntimeError", "RuntimeError", "reversed", "range", "final_top_down_layer"] | 0 | [] | The function (topdown_pass) defined within the public class called LadderVAE, that inherit another class.The function start at line 608 and ends at 747. It contains 78 lines of code and it has a cyclomatic complexity of 10. It takes 9 parameters, represented as [608.0] and does not return any value. It declares 6.0 fun... |
CAREamics_careamics | LadderVAE | public | 0 | 1 | forward | def forward(self, x: torch.Tensor) -> tuple[torch.Tensor, dict[str, torch.Tensor]]:"""Forward pass through the LVAE model.Parameters----------x: torch.TensorThe input tensor of shape (B, C, H, W)."""img_size = x.size()[2:]# Bottom-up inference: return list of length n_layers (bottom to top)bu_values = self.bottomup_pas... | 5 | 15 | 2 | 146 | 0 | 749 | 780 | 749 | self,x | [] | tuple[torch.Tensor, dict[str, torch.Tensor]] | {"Assign": 7, "Expr": 1, "For": 1, "If": 2, "Return": 1} | 8 | 32 | 8 | ["x.size", "self.bottomup_pass", "range", "torch.mean", "enumerate", "self.topdown_pass", "crop_img_tensor", "self.output_layer"] | 54 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3646986_mapbox_mapbox_sdk_py.tests.test_geocoder_py.test_geocoder_forward", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3646986_mapbox_mapbox_sdk_py.tests.test_geocoder_py.test_geocoder_forward_bbox", "_.content.g... | The function (forward) defined within the public class called LadderVAE, that inherit another class.The function start at line 749 and ends at 780. It contains 15 lines of code and it has a cyclomatic complexity of 5. It takes 2 parameters, represented as [749.0] and does not return any value. It declares 8.0 functions... |
CAREamics_careamics | LadderVAE | public | 0 | 1 | get_padded_size | def get_padded_size(self, size):"""Returns the smallest size (H, W) of the image with actual size givenas input, such that H and W are powers of 2.:param size: input size, tuple either (N, C, H, W) or (H, W):return: 2-tuple (H, W)"""# Make size argument into (heigth, width)# assert len(size) in [2, 4, 5] # TODO comment... | 2 | 7 | 2 | 45 | 0 | 783 | 806 | 783 | self,size | [] | Returns | {"Assign": 3, "Expr": 1, "If": 1, "Return": 2} | 1 | 24 | 1 | ["list"] | 0 | [] | The function (get_padded_size) defined within the public class called LadderVAE, that inherit another class.The function start at line 783 and ends at 806. It contains 7 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [783.0], and this function return a value. It declare 1.0... |
CAREamics_careamics | LadderVAE | public | 0 | 1 | get_latent_spatial_size | def get_latent_spatial_size(self, level_idx: int):"""Level_idx: 0 is the bottommost layer, the highest resolution one."""actual_downsampling = level_idx + 1dwnsc = 2**actual_downsamplingsz = self.get_padded_size(self.image_size)h = sz[0] // dwnscw = sz[1] // dwnscassert h == wreturn h | 1 | 8 | 2 | 50 | 0 | 808 | 816 | 808 | self,level_idx | [] | Returns | {"Assign": 5, "Expr": 1, "Return": 1} | 1 | 9 | 1 | ["self.get_padded_size"] | 0 | [] | The function (get_latent_spatial_size) defined within the public class called LadderVAE, that inherit another class.The function start at line 808 and ends at 816. It contains 8 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [808.0], and this function return a value. It dec... |
CAREamics_careamics | LadderVAE | public | 0 | 1 | get_top_prior_param_shape | def get_top_prior_param_shape(self, n_imgs: int = 1):# Compute the total downscaling performed in the Encoderif self.multiscale_decoder_retain_spatial_dims is False:dwnsc = self.overall_downscale_factorelse:# LC allow the encoder latents to keep the same (H, W) size at different levelsactual_downsampling = self.n_layer... | 4 | 13 | 2 | 113 | 0 | 818 | 836 | 818 | self,n_imgs | [] | Returns | {"Assign": 8, "If": 2, "Return": 1} | 0 | 19 | 0 | [] | 0 | [] | The function (get_top_prior_param_shape) defined within the public class called LadderVAE, that inherit another class.The function start at line 818 and ends at 836. It contains 13 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [818.0], and this function return a value.. |
CAREamics_careamics | LadderVAE | public | 0 | 1 | reset_for_inference | def reset_for_inference(self, tile_size: tuple[int, int] | None = None):"""Should be called if we want to predict for a different input/output size."""self.mode_pred = Trueif tile_size is None:tile_size = self.image_sizeself.image_size = tile_sizefor i in range(self.n_layers):self.bottom_up_layers[i].output_expected_sh... | 3 | 10 | 2 | 72 | 0 | 838 | 848 | 838 | self,tile_size | [] | None | {"Assign": 5, "Expr": 1, "For": 1, "If": 1} | 1 | 11 | 1 | ["range"] | 0 | [] | The function (reset_for_inference) defined within the public class called LadderVAE, that inherit another class.The function start at line 838 and ends at 848. It contains 10 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [838.0] and does not return any value. It declare 1.... |
CAREamics_careamics | public | public | 0 | 0 | create_histogram | def create_histogram(bins: int, min_val: float, max_val: float, observation: NDArray, signal: NDArray) -> NDArray:"""Creates a 2D histogram from 'observation' and 'signal'.Parameters----------bins : intNumber of bins in x and y.min_val : floatLower bound of the lowest bin in x and y.max_val : floatUpper bound of the hi... | 1 | 18 | 5 | 198 | 7 | 17 | 71 | 17 | bins,min_val,max_val,observation,signal | ['histogram', 'row_sums', 'obs_to_signal_shape_factor', 'value_range', 'signal_indices', 'signal_values', 'observation_values'] | NDArray | {"Assign": 11, "AugAssign": 1, "Expr": 1, "Return": 1} | 8 | 55 | 8 | ["np.zeros", "int", "np.arange", "ravel", "observation.ravel", "np.histogram2d", "count_histogram.sum", "np.clip"] | 0 | [] | The function (create_histogram) defined within the public class called public.The function start at line 17 and ends at 71. It contains 18 lines of code and it has a cyclomatic complexity of 1. It takes 5 parameters, represented as [17.0] and does not return any value. It declares 8.0 functions, and It has 8.0 functio... |
CAREamics_careamics | public | public | 0 | 0 | noise_model_factory | def noise_model_factory(model_config: Optional[MultiChannelNMConfig],) -> Optional[MultiChannelNoiseModel]:"""Noise model factory.Parameters----------model_config : Optional[MultiChannelNMConfig]Noise model configuration, a `MultiChannelNMConfig` config that definesnoise models for the different output channels.Returns... | 6 | 24 | 1 | 89 | 1 | 74 | 121 | 74 | model_config | ['noise_models'] | Optional[MultiChannelNoiseModel] | {"Assign": 1, "Expr": 2, "For": 1, "If": 4, "Return": 2} | 6 | 48 | 6 | ["noise_models.append", "GaussianMixtureNoiseModel", "NotImplementedError", "NotImplementedError", "NotImplementedError", "MultiChannelNoiseModel"] | 7 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.lightning.lightning_module_py.VAEModule.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.tests.likelihood_modules.test_likelihoods_py.t... | The function (noise_model_factory) defined within the public class called public.The function start at line 74 and ends at 121. It contains 24 lines of code and it has a cyclomatic complexity of 6. The function does not take any parameters and does not return any value. It declares 6.0 functions, It has 6.0 functions c... |
CAREamics_careamics | public | public | 0 | 0 | train_gm_noise_model | def train_gm_noise_model(model_config: GaussianMixtureNMConfig,signal: np.ndarray,observation: np.ndarray,) -> GaussianMixtureNoiseModel:"""Train a Gaussian mixture noise model.Parameters----------model_config : GaussianMixtureNoiseModel_description_Returns-------_description_"""# TODO where to put train params?# TODO ... | 1 | 8 | 3 | 39 | 1 | 124 | 145 | 124 | model_config,signal,observation | ['noise_model'] | GaussianMixtureNoiseModel | {"Assign": 1, "Expr": 2, "Return": 1} | 2 | 22 | 2 | ["GaussianMixtureNoiseModel", "noise_model.fit"] | 0 | [] | The function (train_gm_noise_model) defined within the public class called public.The function start at line 124 and ends at 145. It contains 8 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [124.0] and does not return any value. It declares 2.0 functions, and It has 2.0 f... |
CAREamics_careamics | MultiChannelNoiseModel | public | 0 | 1 | __init__ | def __init__(self, nmodels: list[GaussianMixtureNoiseModel]):"""Constructor.To handle noise models and the relative likelihood computation for multipleoutput channels (e.g., muSplit, denoiseSplit).This class:- receives as input a variable number of noise models, one for each channel.- computes the likelihood of observa... | 6 | 13 | 2 | 91 | 0 | 149 | 179 | 149 | self,nmodels | [] | None | {"Assign": 2, "AugAssign": 1, "Expr": 4, "For": 2, "If": 2} | 7 | 31 | 7 | ["__init__", "super", "torch.device", "torch.cuda.is_available", "enumerate", "self.add_module", "print"] | 8,182 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15197461_googleapis_python_cloud_core.google.cloud._helpers.__init___py._LocalStack.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.AmountMissi... | The function (__init__) defined within the public class called MultiChannelNoiseModel, that inherit another class.The function start at line 149 and ends at 179. It contains 13 lines of code and it has a cyclomatic complexity of 6. It takes 2 parameters, represented as [149.0] and does not return any value. It declares... |
CAREamics_careamics | MultiChannelNoiseModel | public | 0 | 1 | to_device | def to_device(self, device: torch.device):self.device = deviceself.to(device)for ch_idx in range(self._nm_cnt):nmodel = getattr(self, f"nmodel_{ch_idx}")nmodel.to_device(device) | 2 | 6 | 2 | 47 | 0 | 181 | 186 | 181 | self,device | [] | None | {"Assign": 2, "Expr": 2, "For": 1} | 4 | 6 | 4 | ["self.to", "range", "getattr", "nmodel.to_device"] | 10 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3701896_chainer_chainer_chemistry.chainer_chemistry.dataset.converters.cgcnn_converter_py.cgcnn_converter", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3701896_chainer_chainer_chemistry.chainer_chemistry.dataset.c... | The function (to_device) defined within the public class called MultiChannelNoiseModel, that inherit another class.The function start at line 181 and ends at 186. It contains 6 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [181.0] and does not return any value. It declares... |
CAREamics_careamics | MultiChannelNoiseModel | public | 0 | 1 | likelihood | def likelihood(self, obs: torch.Tensor, signal: torch.Tensor) -> torch.Tensor:"""Compute the likelihood of observations given signals for each channel.Parameters----------obs : torch.TensorNoisy observations, i.e., the target(s). Specifically, the input noisyimage for HDN, or the noisy unmixed images used for supervisi... | 3 | 17 | 3 | 137 | 0 | 188 | 221 | 188 | self,obs,signal | [] | torch.Tensor | {"Assign": 2, "Expr": 2, "For": 1, "If": 1, "Return": 2} | 6 | 34 | 6 | ["self.nmodel_0.likelihood", "range", "getattr", "ll_list.append", "nmodel.likelihood", "torch.cat"] | 3 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.tests.likelihood_modules.test_likelihoods_py.test_gaussian_likelihood", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.tests.likelihood_modules.test_likelihoo... | The function (likelihood) defined within the public class called MultiChannelNoiseModel, that inherit another class.The function start at line 188 and ends at 221. It contains 17 lines of code and it has a cyclomatic complexity of 3. It takes 3 parameters, represented as [188.0] and does not return any value. It declar... |
CAREamics_careamics | MultiChannelNoiseModel | public | 0 | 1 | __init__ | def __init__(self, config: GaussianMixtureNMConfig) -> None:super().__init__()self.device = torch.device("cpu")if config.path is not None:params = np.load(config.path)else:params = config.model_dump(exclude_none=True)min_sigma = torch.tensor(params["min_sigma"])min_signal = torch.tensor(params["min_signal"])max_signal ... | 5 | 27 | 2 | 241 | 0 | 266 | 298 | 266 | self,nmodels | [] | None | {"Assign": 2, "AugAssign": 1, "Expr": 4, "For": 2, "If": 2} | 7 | 31 | 7 | ["__init__", "super", "torch.device", "torch.cuda.is_available", "enumerate", "self.add_module", "print"] | 8,182 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15197461_googleapis_python_cloud_core.google.cloud._helpers.__init___py._LocalStack.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.AmountMissi... | The function (__init__) defined within the public class called MultiChannelNoiseModel, that inherit another class.The function start at line 266 and ends at 298. It contains 27 lines of code and it has a cyclomatic complexity of 5. It takes 2 parameters, represented as [266.0] and does not return any value. It declares... |
CAREamics_careamics | GaussianMixtureNoiseModel | public | 0 | 1 | _initialize_weights | def _initialize_weights(self,n_gaussian: int,n_coeff: int,max_signal: torch.Tensor,min_signal: torch.Tensor,) -> torch.Tensor:"""Create random weight initialization."""weight = torch.randn(n_gaussian * 3, n_coeff)weight[n_gaussian : 2 * n_gaussian, 1] = torch.log(max_signal - min_signal).float()return weight | 1 | 12 | 5 | 68 | 0 | 300 | 312 | 300 | self,n_gaussian,n_coeff,max_signal,min_signal | [] | torch.Tensor | {"Assign": 2, "Expr": 1, "Return": 1} | 3 | 13 | 3 | ["torch.randn", "float", "torch.log"] | 0 | [] | The function (_initialize_weights) defined within the public class called GaussianMixtureNoiseModel, that inherit another class.The function start at line 300 and ends at 312. It contains 12 lines of code and it has a cyclomatic complexity of 1. It takes 5 parameters, represented as [300.0] and does not return any valu... |
CAREamics_careamics | MultiChannelNoiseModel | public | 0 | 1 | to_device | def to_device(self, device: torch.device):self.device = deviceself.to(device) | 1 | 3 | 2 | 22 | 0 | 314 | 316 | 314 | self,device | [] | None | {"Assign": 2, "Expr": 2, "For": 1} | 4 | 6 | 4 | ["self.to", "range", "getattr", "nmodel.to_device"] | 10 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3701896_chainer_chainer_chemistry.chainer_chemistry.dataset.converters.cgcnn_converter_py.cgcnn_converter", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3701896_chainer_chainer_chemistry.chainer_chemistry.dataset.c... | The function (to_device) defined within the public class called MultiChannelNoiseModel, that inherit another class.The function start at line 314 and ends at 316. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [314.0] and does not return any value. It declares... |
CAREamics_careamics | GaussianMixtureNoiseModel | public | 0 | 1 | _set_model_mode | def _set_model_mode(self, mode: str) -> None:"""Move parameters to the device and set weights' requires_grad depending on the mode"""if mode == "train":self.weight.requires_grad = Trueelse:self.weight.requires_grad = False | 2 | 5 | 2 | 33 | 0 | 318 | 323 | 318 | self,mode | [] | None | {"Assign": 2, "Expr": 1, "If": 1} | 0 | 6 | 0 | [] | 0 | [] | The function (_set_model_mode) defined within the public class called GaussianMixtureNoiseModel, that inherit another class.The function start at line 318 and ends at 323. It contains 5 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [318.0] and does not return any value.. |
CAREamics_careamics | GaussianMixtureNoiseModel | public | 0 | 1 | polynomial_regressor | def polynomial_regressor(self, weight_params: torch.Tensor, signals: torch.Tensor) -> torch.Tensor:"""Combines `weight_params` and signal `signals` to regress for the gaussian parameter values.Parameters----------weight_params : TensorCorresponds to specific rows of the `self.weight`signals : TensorSignalsReturns------... | 2 | 9 | 3 | 75 | 0 | 325 | 348 | 325 | self,weight_params,signals | [] | torch.Tensor | {"Assign": 1, "AugAssign": 1, "Expr": 1, "For": 1, "Return": 1} | 2 | 24 | 2 | ["torch.zeros_like", "range"] | 0 | [] | The function (polynomial_regressor) defined within the public class called GaussianMixtureNoiseModel, that inherit another class.The function start at line 325 and ends at 348. It contains 9 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [325.0] and does not return any valu... |
CAREamics_careamics | GaussianMixtureNoiseModel | public | 0 | 1 | normal_density | def normal_density(self, x: torch.Tensor, mean: torch.Tensor, std: torch.Tensor) -> torch.Tensor:"""Evaluates the normal probability density at `x` given the mean `mean` and standard deviation `std`.Parameters----------x: torch.TensorThe ground-truth tensor. Shape is (batch, 1, dim1, dim2).mean: torch.TensorThe inferre... | 1 | 8 | 4 | 85 | 0 | 350 | 374 | 350 | self,x,mean,std | [] | torch.Tensor | {"Assign": 4, "Expr": 1, "Return": 1} | 2 | 25 | 2 | ["torch.exp", "torch.sqrt"] | 0 | [] | The function (normal_density) defined within the public class called GaussianMixtureNoiseModel, that inherit another class.The function start at line 350 and ends at 374. It contains 8 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [350.0] and does not return any value. It ... |
CAREamics_careamics | MultiChannelNoiseModel | public | 0 | 1 | likelihood | def likelihood(self, observations: torch.Tensor, signals: torch.Tensor) -> torch.Tensor:"""Evaluates the likelihood of observations given the signals and the corresponding gaussian parameters.Parameters----------observations : TensorNoisy observations. Shape is (batch, 1, dim1, dim2).signals : TensorUnderlying signals.... | 2 | 18 | 3 | 106 | 0 | 376 | 411 | 376 | self,obs,signal | [] | torch.Tensor | {"Assign": 2, "Expr": 2, "For": 1, "If": 1, "Return": 2} | 6 | 34 | 6 | ["self.nmodel_0.likelihood", "range", "getattr", "ll_list.append", "nmodel.likelihood", "torch.cat"] | 3 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.tests.likelihood_modules.test_likelihoods_py.test_gaussian_likelihood", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.tests.likelihood_modules.test_likelihoo... | The function (likelihood) defined within the public class called MultiChannelNoiseModel, that inherit another class.The function start at line 376 and ends at 411. It contains 18 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [376.0] and does not return any value. It declar... |
CAREamics_careamics | GaussianMixtureNoiseModel | public | 0 | 1 | get_gaussian_parameters | def get_gaussian_parameters(self, signals: torch.Tensor) -> list[torch.Tensor]:"""Returns the noise model for given signalsParameters----------signals : TensorUnderlying signalsReturns-------noise_model: list of TensorContains a list of `mu`, `sigma` and `alpha` for the `signals`"""noise_model = []mu = []sigma = []alph... | 9 | 34 | 2 | 298 | 0 | 413 | 471 | 413 | self,signals | [] | list[torch.Tensor] | {"Assign": 15, "Expr": 7, "For": 8, "Return": 1} | 21 | 59 | 21 | ["range", "mu.append", "self.polynomial_regressor", "torch.exp", "self.polynomial_regressor", "torch.clamp", "sigma.append", "torch.sqrt", "torch.exp", "self.polynomial_regressor", "alpha.append", "range", "range", "range", "range", "range", "noise_model.append", "range", "noise_model.append", "range", "noise_model.app... | 0 | [] | The function (get_gaussian_parameters) defined within the public class called GaussianMixtureNoiseModel, that inherit another class.The function start at line 413 and ends at 471. It contains 34 lines of code and it has a cyclomatic complexity of 9. It takes 2 parameters, represented as [413.0] and does not return any ... |
CAREamics_careamics | GaussianMixtureNoiseModel | public | 0 | 1 | _fast_shuffle | def _fast_shuffle(series: torch.Tensor, num: int) -> torch.Tensor:"""Shuffle the inputs randomly num times"""length = series.shape[0]for _ in range(num):idx = torch.randperm(length)series = series[idx, :]return series | 2 | 6 | 2 | 52 | 0 | 474 | 480 | 474 | series,num | [] | torch.Tensor | {"Assign": 3, "Expr": 1, "For": 1, "Return": 1} | 2 | 7 | 2 | ["range", "torch.randperm"] | 0 | [] | The function (_fast_shuffle) defined within the public class called GaussianMixtureNoiseModel, that inherit another class.The function start at line 474 and ends at 480. It contains 6 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [474.0] and does not return any value. It d... |
CAREamics_careamics | GaussianMixtureNoiseModel | public | 0 | 1 | get_signal_observation_pairs | def get_signal_observation_pairs(self,signal: NDArray,observation: NDArray,lower_clip: float,upper_clip: float,) -> torch.Tensor:"""Returns the Signal-Observation pixel intensities as a two-column arrayParameters----------signal : numpy arrayClean Signal Dataobservation: numpy arrayNoisy observation Datalower_clip: flo... | 2 | 23 | 5 | 200 | 0 | 482 | 523 | 482 | self,signal,observation,lower_clip,upper_clip | [] | torch.Tensor | {"Assign": 12, "Expr": 1, "For": 1, "Return": 1} | 9 | 42 | 9 | ["np.percentile", "np.percentile", "np.zeros", "range", "ravel", "ravel", "sig_obs_pairs.astype", "torch.from_numpy", "self._fast_shuffle"] | 0 | [] | The function (get_signal_observation_pairs) defined within the public class called GaussianMixtureNoiseModel, that inherit another class.The function start at line 482 and ends at 523. It contains 23 lines of code and it has a cyclomatic complexity of 2. It takes 5 parameters, represented as [482.0] and does not return... |
CAREamics_careamics | GaussianMixtureNoiseModel | public | 0 | 1 | fit | def fit(self,signal: NDArray,observation: NDArray,learning_rate: float = 1e-1,batch_size: int = 250000,n_epochs: int = 2000,lower_clip: float = 0.0,upper_clip: float = 100.0,) -> list[float]:"""Training to learn the noise model from signal - observation pairs.Parameters----------signal: numpy arrayClean Signal Dataobse... | 7 | 48 | 8 | 348 | 0 | 525 | 600 | 525 | self,signal,observation,learning_rate,batch_size,n_epochs,lower_clip,upper_clip | [] | list[float] | {"Assign": 13, "AugAssign": 1, "Expr": 12, "For": 1, "If": 3, "Return": 1} | 29 | 76 | 29 | ["self._set_model_mode", "torch.device", "torch.cuda.is_available", "self.to_device", "torch.optim.Adam", "self.get_signal_observation_pairs", "range", "self._fast_shuffle", "to", "to", "self.likelihood", "torch.mean", "torch.log", "train_losses.append", "joint_loss.item", "any", "self.weight.isnan", "any", "self.weigh... | 8 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3659638_climbsrocks_auto_ml.auto_ml.DataFrameVectorizer_py.DataFrameVectorizer.fit", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3659638_climbsrocks_auto_ml.auto_ml.utils_data_cleaning_py.BasicDataCleaning.fit", "... | The function (fit) defined within the public class called GaussianMixtureNoiseModel, that inherit another class.The function start at line 525 and ends at 600. It contains 48 lines of code and it has a cyclomatic complexity of 7. It takes 8 parameters, represented as [525.0] and does not return any value. It declares 2... |
CAREamics_careamics | GaussianMixtureNoiseModel | public | 0 | 1 | sample_observation_from_signal | def sample_observation_from_signal(self, signal: NDArray) -> NDArray:"""Sample an instance of observation based on an input signal using alearned Gaussian Mixture Model. For each pixel in the input signal,samples a corresponding noisy pixel.Parameters----------signal: numpy arrayClean 2D signal data.Returns-------obser... | 2 | 29 | 2 | 258 | 0 | 602 | 657 | 602 | self,signal | [] | NDArray | {"Assign": 15, "Expr": 1, "If": 1, "Return": 1, "With": 1} | 17 | 56 | 17 | ["len", "to", "torch.from_numpy", "torch.no_grad", "self.get_gaussian_parameters", "np.array", "np.array", "np.array", "np.random.normal", "np.random.rand", "np.cumsum", "np.argmax", "np.take_along_axis", "np.take_along_axis", "selected_mus.squeeze", "selected_stds.squeeze", "np.random.normal"] | 0 | [] | The function (sample_observation_from_signal) defined within the public class called GaussianMixtureNoiseModel, that inherit another class.The function start at line 602 and ends at 657. It contains 29 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [602.0] and does not retu... |
CAREamics_careamics | GaussianMixtureNoiseModel | public | 0 | 1 | save | def save(self, path: str, name: str) -> None:"""Save the trained parameters on the noise model.Parameters----------path : strPath to save the trained parameters.name : strFile name to save the trained parameters."""os.makedirs(path, exist_ok=True)np.savez(os.path.join(path, name),trained_weight=self.weight.numpy(),min_... | 1 | 10 | 3 | 88 | 0 | 659 | 677 | 659 | self,path,name | [] | None | {"Expr": 4} | 7 | 19 | 7 | ["os.makedirs", "np.savez", "os.path.join", "self.weight.numpy", "self.min_signal.numpy", "self.max_signal.numpy", "print"] | 233 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3508964_balanced_balanced_python.balanced.resources_py.Account.settle", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3508964_balanced_balanced_python.balanced.resources_py.BankAccount.verify", "_.content.gdrive.MyD... | The function (save) defined within the public class called GaussianMixtureNoiseModel, that inherit another class.The function start at line 659 and ends at 677. It contains 10 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [659.0] and does not return any value. It declares ... |
CAREamics_careamics | NormalStochasticBlock | public | 0 | 1 | __init__ | def __init__(self,c_in: int,c_vars: int,c_out: int,conv_dims: int = 2,kernel: int = 3,transform_p_params: bool = True,vanilla_latent_hw: int = None,use_naive_exponential: bool = False,):"""Parameters----------c_in: intThe number of channels of the input tensor.c_vars: intThe number of channels of the latent space tenso... | 2 | 26 | 9 | 167 | 0 | 43 | 99 | 43 | self,c_in,c_vars,c_out,conv_dims,kernel,transform_p_params,vanilla_latent_hw,use_naive_exponential | [] | None | {"AnnAssign": 1, "Assign": 11, "Expr": 2, "If": 1} | 6 | 57 | 6 | ["__init__", "super", "getattr", "conv_layer", "conv_layer", "conv_layer"] | 8,182 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15197461_googleapis_python_cloud_core.google.cloud._helpers.__init___py._LocalStack.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.AmountMissi... | The function (__init__) defined within the public class called NormalStochasticBlock, that inherit another class.The function start at line 43 and ends at 99. It contains 26 lines of code and it has a cyclomatic complexity of 2. It takes 9 parameters, represented as [43.0] and does not return any value. It declares 6.0... |
CAREamics_careamics | NormalStochasticBlock | public | 0 | 1 | get_z | def get_z(self,sampling_distrib: torch.distributions.normal.Normal,forced_latent: Union[torch.Tensor, None],mode_pred: bool,use_uncond_mode: bool,) -> torch.Tensor:"""Sample a latent tensor from the given latent distribution.Latent tensor can be obtained is several ways:- Sampled from the (Gaussian) latent distribution... | 4 | 18 | 5 | 81 | 0 | 101 | 138 | 101 | self,sampling_distrib,forced_latent,mode_pred,use_uncond_mode | [] | torch.Tensor | {"Assign": 4, "Expr": 1, "If": 3, "Return": 1} | 2 | 38 | 2 | ["sampling_distrib.rsample", "sampling_distrib.rsample"] | 0 | [] | The function (get_z) defined within the public class called NormalStochasticBlock, that inherit another class.The function start at line 101 and ends at 138. It contains 18 lines of code and it has a cyclomatic complexity of 4. It takes 5 parameters, represented as [101.0] and does not return any value. It declares 2.0... |
CAREamics_careamics | NormalStochasticBlock | public | 0 | 1 | sample_from_q | def sample_from_q(self, q_params: torch.Tensor, var_clip_max: float) -> torch.Tensor:"""Given an input parameter tensor defining q(z),it processes it by calling `process_q_params()` method andsample a latent tensor from the resulting distribution.Parameters----------q_params: torch.TensorThe input tensor to be processe... | 1 | 5 | 3 | 40 | 0 | 140 | 157 | 140 | self,q_params,var_clip_max | [] | torch.Tensor | {"Assign": 1, "Expr": 1, "Return": 1} | 2 | 18 | 2 | ["self.process_q_params", "q.rsample"] | 0 | [] | The function (sample_from_q) defined within the public class called NormalStochasticBlock, that inherit another class.The function start at line 140 and ends at 157. It contains 5 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [140.0] and does not return any value. It decla... |
CAREamics_careamics | NormalStochasticBlock | public | 0 | 1 | compute_kl_metrics | def compute_kl_metrics(self,p: torch.distributions.normal.Normal,p_params: torch.Tensor,q: torch.distributions.normal.Normal,q_params: torch.Tensor,mode_pred: bool,analytical_kl: bool,z: torch.Tensor,) -> Dict[str, torch.Tensor]:"""Compute KL (analytical or MC estimate) and then process it, extracting composed versions... | 4 | 36 | 8 | 230 | 0 | 159 | 228 | 159 | self,p,p_params,q,q_params,mode_pred,analytical_kl,z | [] | Dict[str, torch.Tensor] | {"Assign": 13, "Expr": 1, "If": 3, "Return": 1} | 9 | 70 | 9 | ["kl_divergence", "kl_normal_mc", "tuple", "range", "len", "kl_elementwise.sum", "kl_elementwise.sum", "tmp.sum", "kl_elementwise.sum"] | 0 | [] | The function (compute_kl_metrics) defined within the public class called NormalStochasticBlock, that inherit another class.The function start at line 159 and ends at 228. It contains 36 lines of code and it has a cyclomatic complexity of 4. It takes 8 parameters, represented as [159.0] and does not return any value. It... |
CAREamics_careamics | NormalStochasticBlock | public | 0 | 1 | process_p_params | def process_p_params(self, p_params: torch.Tensor, var_clip_max: float) -> Tuple[torch.Tensor, torch.Tensor, torch.distributions.normal.Normal]:"""Process the input parameters to get the prior distribution p(z_i|z_{i+1}) (or p(z_L)).Processing consists in:- (optionally) 2D convolution on the input tensor to increase nu... | 3 | 14 | 3 | 136 | 0 | 230 | 262 | 230 | self,p_params,var_clip_max | [] | Tuple[torch.Tensor, torch.Tensor, torch.distributions.normal.Normal] | {"Assign": 6, "Expr": 1, "If": 2, "Return": 1} | 9 | 33 | 9 | ["self.conv_in_p", "p_params.size", "p_params.chunk", "torch.clip", "StableMean", "StableLogVar", "Normal", "p_mu.get", "p_lv.get_std"] | 0 | [] | The function (process_p_params) defined within the public class called NormalStochasticBlock, that inherit another class.The function start at line 230 and ends at 262. It contains 14 lines of code and it has a cyclomatic complexity of 3. It takes 3 parameters, represented as [230.0] and does not return any value. It d... |
CAREamics_careamics | NormalStochasticBlock | public | 0 | 1 | process_q_params | def process_q_params(self, q_params: torch.Tensor, var_clip_max: float, allow_oddsizes: bool = False) -> Tuple[torch.Tensor, torch.Tensor, torch.distributions.normal.Normal]:"""Process the input parameters to get the inference distribution q(z_i|z_{i+1}) (or q(z|x)).Processing consists in:- convolution on the input ten... | 4 | 14 | 4 | 175 | 0 | 264 | 298 | 264 | self,q_params,var_clip_max,allow_oddsizes | [] | Tuple[torch.Tensor, torch.Tensor, torch.distributions.normal.Normal] | {"Assign": 8, "Expr": 1, "If": 2, "Return": 1} | 10 | 35 | 10 | ["self.conv_in_q", "q_params.chunk", "torch.clip", "F.center_crop", "F.center_crop", "StableMean", "StableLogVar", "Normal", "q_mu.get", "q_lv.get_std"] | 0 | [] | The function (process_q_params) defined within the public class called NormalStochasticBlock, that inherit another class.The function start at line 264 and ends at 298. It contains 14 lines of code and it has a cyclomatic complexity of 4. It takes 4 parameters, represented as [264.0] and does not return any value. It d... |
CAREamics_careamics | NormalStochasticBlock | public | 0 | 1 | forward | def forward(self,p_params: torch.Tensor,q_params: Union[torch.Tensor, None] = None,forced_latent: Union[torch.Tensor, None] = None,force_constant_output: bool = False,analytical_kl: bool = False,mode_pred: bool = False,use_uncond_mode: bool = False,var_clip_max: Union[float, None] = None,) -> Tuple[torch.Tensor, Dict[s... | 6 | 49 | 9 | 396 | 0 | 300 | 394 | 300 | self,p_params,q_params,forced_latent,force_constant_output,analytical_kl,mode_pred,use_uncond_mode,var_clip_max | [] | Tuple[torch.Tensor, Dict[str, torch.Tensor]] | {"Assign": 23, "Expr": 3, "If": 4, "Return": 1} | 22 | 95 | 22 | ["self.process_p_params", "self.process_q_params", "torch.max", "q_lv.get", "q_mu.get", "p_mu.get", "p_mu.centercrop_to_size", "p_lv.centercrop_to_size", "self.get_z", "clone", "expand_as", "clone", "expand_as", "clone", "expand_as", "self.conv_out", "sum", "q.log_prob", "tuple", "range", "z.dim", "self.compute_kl_metr... | 54 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3646986_mapbox_mapbox_sdk_py.tests.test_geocoder_py.test_geocoder_forward", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3646986_mapbox_mapbox_sdk_py.tests.test_geocoder_py.test_geocoder_forward_bbox", "_.content.g... | The function (forward) defined within the public class called NormalStochasticBlock, that inherit another class.The function start at line 300 and ends at 394. It contains 49 lines of code and it has a cyclomatic complexity of 6. It takes 9 parameters, represented as [300.0] and does not return any value. It declares 2... |
CAREamics_careamics | public | public | 0 | 0 | torch_nanmean | def torch_nanmean(inp):return torch.mean(inp[~inp.isnan()]) | 1 | 2 | 1 | 20 | 0 | 14 | 15 | 14 | inp | [] | Returns | {"Return": 1} | 2 | 2 | 2 | ["torch.mean", "inp.isnan"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.lvae_training.lightning_module_py.LadderVAELight.validation_step"] | The function (torch_nanmean) defined within the public class called public.The function start at line 14 and ends at 15. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value. It declares 2.0 functions, It has 2.0 functions calle... |
CAREamics_careamics | public | public | 0 | 0 | power_of_2 | def power_of_2(self, x):assert isinstance(x, int)if x == 1:return Trueif x == 0:# happens with validationreturn Falseif x % 2 == 1:return Falsereturn self.power_of_2(x // 2) | 4 | 9 | 2 | 44 | 0 | 18 | 27 | 18 | self,x | [] | Returns | {"If": 3, "Return": 4} | 2 | 10 | 2 | ["isinstance", "self.power_of_2"] | 0 | [] | The function (power_of_2) defined within the public class called public.The function start at line 18 and ends at 27. It contains 9 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [18.0], and this function return a value. It declares 2.0 functions, and It has 2.0 functions ... |
CAREamics_careamics | Enum | public | 0 | 0 | name | def name(cls, enum_type):for key, value in cls.__dict__.items():if enum_type == value:return key | 3 | 4 | 2 | 27 | 0 | 32 | 35 | 32 | cls,enum_type | [] | Returns | {"For": 1, "If": 1, "Return": 1} | 1 | 4 | 1 | ["cls.__dict__.items"] | 27 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3665918_alvinwan_neural_backed_decision_trees.nbdt.graph_py.build_minimal_wordnet_graph", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3694991_frostyx_tracer.tracer.controllers.helper_py.HelperController._affects",... | The function (name) defined within the public class called Enum.The function start at line 32 and ends at 35. It contains 4 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [32.0], and this function return a value. It declare 1.0 function, It has 1.0 function called inside wh... |
CAREamics_careamics | Enum | public | 0 | 0 | contains | def contains(cls, enum_type):for key, value in cls.__dict__.items():if enum_type == value:return Truereturn False | 3 | 5 | 2 | 29 | 0 | 38 | 42 | 38 | cls,enum_type | [] | Returns | {"For": 1, "If": 1, "Return": 2} | 1 | 5 | 1 | ["cls.__dict__.items"] | 24 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.56769247_dmwm_cmsspark.src.python.CMSSpark.hpc_running_cores_and_corehr_py.get_raw_df", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.69650689_citrineinformatics_gemd_python.gemd.entity.bounds.categorical_bounds_py.... | The function (contains) defined within the public class called Enum.The function start at line 38 and ends at 42. It contains 5 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [38.0], and this function return a value. It declare 1.0 function, It has 1.0 function called insid... |
CAREamics_careamics | Enum | public | 0 | 0 | from_name | def from_name(cls, enum_type_str):for key, value in cls.__dict__.items():if key == enum_type_str:return valueassert f"{cls.__name__}:{enum_type_str} doesnot exist." | 3 | 5 | 2 | 30 | 0 | 45 | 49 | 45 | cls,enum_type_str | [] | Returns | {"For": 1, "If": 1, "Return": 1} | 1 | 5 | 1 | ["cls.__dict__.items"] | 0 | [] | The function (from_name) defined within the public class called Enum.The function start at line 45 and ends at 49. It contains 5 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [45.0], and this function return a value. It declare 1.0 function, and It has 1.0 function called... |
CAREamics_careamics | public | public | 0 | 0 | _pad_crop_img | def _pad_crop_img(x: torch.Tensor, size: Sequence[int], mode: Literal["crop", "pad"]) -> torch.Tensor:"""Pads or crops a tensor.Pads or crops a tensor of shape (B, C, [Z], Y, X) to new shape.Parameters:-----------x: torch.TensorInput image of shape (B, C, [Z], Y, X)size: Sequence[int]Desired size ([Z*], Y*, X*)mode: Li... | 16 | 32 | 3 | 411 | 7 | 98 | 153 | 98 | x,size,mode | ['d1', 'size', 'd2', 'padding', 'cond', 'x_size', 'diffs'] | torch.Tensor | {"Assign": 9, "Expr": 1, "If": 9, "Return": 3} | 20 | 56 | 20 | ["x.dim", "len", "x.dim", "len", "tuple", "x.size", "any", "range", "len", "any", "range", "len", "ValueError", "abs", "zip", "x.dim", "x.dim", "nn.functional.pad", "x.dim", "x.dim"] | 2 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.models.lvae.utils_py.crop_img_tensor", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.models.lvae.utils_py.pad_img_tensor"] | The function (_pad_crop_img) defined within the public class called public.The function start at line 98 and ends at 153. It contains 32 lines of code and it has a cyclomatic complexity of 16. It takes 3 parameters, represented as [98.0] and does not return any value. It declares 20.0 functions, It has 20.0 functions c... |
CAREamics_careamics | public | public | 0 | 0 | pad_img_tensor | def pad_img_tensor(x: torch.Tensor, size: Sequence[int]) -> torch.Tensor:"""Pads a tensorPads a tensor of shape (B, C, [Z], Y, X) to desired spatial dimensions.Parameters:-----------x (torch.Tensor): Input image of shape (B, C, [Z], Y, X)size (list or tuple): Desired size([Z*], Y*, X*)Returns:--------The padded tensor"... | 1 | 2 | 2 | 30 | 0 | 156 | 170 | 156 | x,size | [] | torch.Tensor | {"Expr": 1, "Return": 1} | 1 | 15 | 1 | ["_pad_crop_img"] | 4 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.models.lvae.layers_py.MergeLowRes.forward", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.tests.models.lvae.test_utils_py.test_pad_img_assert",... | The function (pad_img_tensor) defined within the public class called public.The function start at line 156 and ends at 170. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [156.0] and does not return any value. It declare 1.0 function, It has 1.0 function calle... |
CAREamics_careamics | public | public | 0 | 0 | crop_img_tensor | def crop_img_tensor(x, size) -> torch.Tensor:"""Crops a tensor.Crops a tensor of shape (batch, channels, h, w) to a desired height and widthgiven by a tuple.Args:x (torch.Tensor): Input imagesize (list or tuple): Desired size (height, width)Returns-------The cropped tensor"""return _pad_crop_img(x, size, "crop") | 1 | 2 | 2 | 21 | 0 | 173 | 185 | 173 | x,size | [] | torch.Tensor | {"Expr": 1, "Return": 1} | 1 | 13 | 1 | ["_pad_crop_img"] | 6 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.models.lvae.layers_py.BottomUpLayer.forward", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.models.lvae.layers_py.TopDownLayer.fo... | The function (crop_img_tensor) defined within the public class called public.The function start at line 173 and ends at 185. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [173.0] and does not return any value. It declare 1.0 function, It has 1.0 function call... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.