Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/SagiPolaczek/NeuralSVG
/ functions
Functions
216 in github.com/SagiPolaczek/NeuralSVG
⨍
Functions
216
◇
Types & classes
36
↓ 15 callers
Method
get_image
( self, mode="train", truncation_indices: list[int] = None, sub_layers_sizes:
src/models/painter.py:155
↓ 12 callers
Function
tensor2im
Convert tensor to PIL image.
src/training/utils/vis_utils.py:19
↓ 7 callers
Method
save_svg
(self, output_dir: Path, name: str)
src/models/painter.py:205
↓ 6 callers
Method
__init__
( self, embed_dim: int, # vision image_resolution: int, vision_layers:
CLIP_/clip/model.py:355
↓ 5 callers
Method
forward
Forward pass through MLP.
src/models/nerf_mlp_multi.py:657
↓ 5 callers
Method
log_message
Log a message to all outputs. Args: message: Message to log
src/training/logging/coach_logger.py:73
↓ 4 callers
Method
_make_layer
(self, planes, blocks, stride=1)
CLIP_/clip/model.py:155
↓ 3 callers
Method
__init__
Initialize custom MLP.
src/models/nerf_mlp_multi.py:607
↓ 3 callers
Method
_infer_with_color
Run inference with a specific color. Args: save_filename (str): Base filename for saving outputs output_dir (Path): D
src/training/coach.py:706
↓ 3 callers
Function
create_dir
Create directory if not exists. Args: dir_path: Directory path Returns: Created directory path
src/training/utils/coach_utils.py:102
↓ 3 callers
Method
encode
(self, text)
CLIP_/clip/simple_tokenizer.py:133
↓ 3 callers
Function
multi_head_attention_forward
( query: Tensor, key: Tensor, value: Tensor, embed_dim_to_check: int, num_heads: int,
CLIP_/clip/auxilary.py:28
↓ 3 callers
Method
render_scene
(self, shapes, shape_groups)
src/models/painter.py:126
↓ 3 callers
Method
train
Execute the main training loop. This method runs the main training loop, handling: - Batch processing and forward passes
src/training/coach.py:100
↓ 2 callers
Method
_get_background_color
Get background color based on settings.
src/models/painter_nerf.py:308
↓ 2 callers
Method
_get_total_num_points
( control_points_per_seg: int, num_segments: int, is_closed: bool )
src/models/painter.py:366
↓ 2 callers
Function
_transform
(n_px)
CLIP_/clip/clip.py:73
↓ 2 callers
Method
apply_nested_dropout
Apply nested dropout to embedding.
src/models/nerf_mlp_multi.py:414
↓ 2 callers
Function
bytes_to_unicode
Returns list of utf-8 byte and a corresponding list of unicode strings. The reversible bpe codes work on unicode strings. This means you
CLIP_/clip/simple_tokenizer.py:18
↓ 2 callers
Method
calc_loss
Calculate the loss for regular training. Args: pred (Tensor): Predicted tensor toggle_color_value (Optional[str]): Co
src/training/coach.py:958
↓ 2 callers
Method
calc_pretrain_loss
Calculate the loss for pretraining. Args: pred (Tensor): Predicted tensor gt (Tensor): Ground truth tensor
src/training/coach.py:988
↓ 2 callers
Method
checkpoint_me
Save a model checkpoint. Args: is_best (bool): Whether this is the best model so far. Defaults to False. is_final (bo
src/training/coach.py:812
↓ 2 callers
Method
embed_text
Generate text embeddings.
src/training/losses.py:151
↓ 2 callers
Method
encode_image
(self, image, attn_map=None, mode="train")
CLIP_/clip/model.py:461
↓ 2 callers
Function
get_pairs
Return set of symbol pairs in a word. Word is represented as tuple of symbols (symbols being variable-length strings).
CLIP_/clip/simple_tokenizer.py:44
↓ 2 callers
Method
get_points
( self, mode="train", truncation_indices: list[int] = None, toggle_color_value
src/models/painter.py:142
↓ 2 callers
Method
mlp_pass
(self, mode: str, eps: float = 1e-4, truncation_idx: int = None)
src/models/painter.py:123
↓ 2 callers
Function
patch_device
(module)
CLIP_/clip/clip.py:157
↓ 2 callers
Function
patch_float
(module)
CLIP_/clip/clip.py:181
↓ 2 callers
Function
post_process_sampled_indices
(*, sampled_inds_list, attn_map, image_size)
src/models/attention_utils.py:148
↓ 2 callers
Function
softmax
(x, tau=0.2)
src/models/attention_utils.py:188
↓ 2 callers
Method
update_step
Update current training step.
src/training/logging/coach_logger.py:89
↓ 1 callers
Method
__init__
(self, in_features: int, out_features: int)
CLIP_/clip/auxilary.py:24
↓ 1 callers
Method
_add_aspect_ratio_encoding
Add aspect ratio encoding.
src/models/nerf_mlp_multi.py:340
↓ 1 callers
Method
_add_aspect_ratio_rects
Add aspect ratio rectangles to shapes and groups.
src/models/painter_nerf.py:369
↓ 1 callers
Method
_add_color_encoding
Add color encoding.
src/models/nerf_mlp_multi.py:360
↓ 1 callers
Method
_create_background_shape
Create background rectangle shape.
src/models/painter_nerf.py:323
↓ 1 callers
Method
_create_color_embedding
Create color toggle embedding.
src/models/nerf_mlp_multi.py:195
↓ 1 callers
Method
_create_embeddings
Create embedding layers.
src/models/nerf_mlp_multi.py:165
↓ 1 callers
Method
_create_layers
Create network layers.
src/models/nerf_mlp_multi.py:633
↓ 1 callers
Method
_create_mlps
Create main MLPs for points and colors.
src/models/nerf_mlp_multi.py:218
↓ 1 callers
Method
_create_shapes_and_groups
Create shapes and shape groups for rendering.
src/models/painter_nerf.py:233
↓ 1 callers
Method
_create_stroke_color
Create stroke color with opacity.
src/models/painter_nerf.py:341
↓ 1 callers
Function
_download
(url: str, root: str = os.environ.get("CLIP_CACHE", "~/.cache/clip"))
CLIP_/clip/clip.py:26
↓ 1 callers
Method
_exp_ramp_cosine_decay
Calculate learning rate using exponential ramp and cosine decay. Args: step (int): Current step Returns: flo
src/training/coach.py:1120
↓ 1 callers
Method
_generate_outputs
Generate network outputs.
src/models/nerf_mlp_multi.py:398
↓ 1 callers
Method
_get_aspect_ratio_value
Get aspect ratio value for current step.
src/training/coach.py:562
↓ 1 callers
Method
_get_base_encoding
Get base positional encoding.
src/models/nerf_mlp_multi.py:327
↓ 1 callers
Method
_get_color_encoding
Get color encoding based on method.
src/models/nerf_mlp_multi.py:376
↓ 1 callers
Method
_get_color_suffix
Generate suffix for color-specific output files. Args: color_value (Optional[Union[str, torch.Tensor]]): Color value
src/training/coach.py:740
↓ 1 callers
Method
_get_mlp_predictions
Get predictions from MLP.
src/models/painter_nerf.py:182
↓ 1 callers
Method
_get_number_of_shapes
Get number of shapes to process.
src/models/painter_nerf.py:330
↓ 1 callers
Method
_get_path
(self, idx: int)
src/models/painter.py:255
↓ 1 callers
Method
_get_shape
(self, idx: int)
src/models/painter.py:285
↓ 1 callers
Method
_get_stroke_color_to_render
Get stroke color for rendering.
src/models/painter_nerf.py:359
↓ 1 callers
Method
_get_truncation_idx
Calculate truncation indices for shape introduction.
src/training/coach.py:553
↓ 1 callers
Method
_handle_nested_dropout
Handle nested dropout and return truncation index.
src/models/painter_nerf.py:168
↓ 1 callers
Method
_infer_single
Run single inference without interpolation.
src/training/coach.py:694
↓ 1 callers
Method
_init_colors
(self)
src/models/painter.py:328
↓ 1 callers
Method
_init_colors_toggled
(self, eps=1e-1)
src/models/painter.py:340
↓ 1 callers
Method
_init_radiuses
(self)
src/models/painter.py:362
↓ 1 callers
Method
_init_strokes
src/models/painter.py:216
↓ 1 callers
Method
_init_strokes_with_attention_map
(self)
src/models/painter.py:407
↓ 1 callers
Method
_initialize_and_save_sketch
Initialize and save initial sketch state.
src/training/coach.py:408
↓ 1 callers
Method
_initialize_dimensions
Initialize network dimensions.
src/models/nerf_mlp_multi.py:128
↓ 1 callers
Method
_initialize_mlp
Initialize NeRF MLP model.
src/models/painter_nerf.py:42
↓ 1 callers
Method
_initialize_parameters
Initialize model parameters.
src/models/nerf_mlp_multi.py:239
↓ 1 callers
Method
_initialize_renderer
Initialize and configure the PainterNerf renderer.
src/models/model.py:49
↓ 1 callers
Method
_initialize_toggle_values
Initialize color and aspect ratio toggle values.
src/models/painter_nerf.py:132
↓ 1 callers
Method
_interpolate_colors
Interpolate between two colors during inference.
src/training/coach.py:671
↓ 1 callers
Method
_linear_ramp_cosine_decay
Calculate learning rate using linear ramp and cosine decay. Args: step (int): Current step Returns: float: L
src/training/coach.py:1100
↓ 1 callers
Method
_load_checkpoint
Load model weights from checkpoint.
src/models/model.py:55
↓ 1 callers
Method
_log_to_wandb
Log metrics to wandb. Args: loss_dict: Dictionary of loss components
src/training/coach.py:583
↓ 1 callers
Method
_plot_attention_map_if_needed
Plot attention maps if available.
src/training/coach.py:445
↓ 1 callers
Method
_process_colors
Process colors tensor.
src/models/nerf_mlp_multi.py:294
↓ 1 callers
Method
_process_points
Process points tensor and apply aspect ratio.
src/models/painter_nerf.py:199
↓ 1 callers
Method
_process_pretrain_color
Process a color during the pretraining phase. Args: toggle_color_value: Color value to process Returns:
src/training/coach.py:494
↓ 1 callers
Method
_process_regular_color
Process a single color value during regular training. Args: toggle_color_value: Color value to process Returns:
src/training/coach.py:526
↓ 1 callers
Method
_process_strokes
Process stroke points tensor.
src/models/nerf_mlp_multi.py:287
↓ 1 callers
Method
_process_widths_and_opacities
Process width and opacity tensors.
src/models/painter_nerf.py:216
↓ 1 callers
Method
_reset_parameters
(self)
CLIP_/clip/auxilary.py:433
↓ 1 callers
Method
_setup_training_params
Initialize training parameters and state. Sets up: - Initial learning rates - Optimizer parameters - Trainin
src/training/coach.py:79
↓ 1 callers
Method
_sinusoidal_ramp_exponential_decay
Calculate learning rate using sinusoidal ramp and exponential decay. Args: step (int): Current step Returns:
src/training/coach.py:1079
↓ 1 callers
Method
_store_config
Store configuration parameters.
src/models/nerf_mlp_multi.py:86
↓ 1 callers
Method
_validate_sub_layers
Validate and process sub-layer sizes.
src/models/painter_nerf.py:146
↓ 1 callers
Method
attention
(self, x: torch.Tensor, attn_mask: torch.Tensor = None, mode="train")
CLIP_/clip/model.py:231
↓ 1 callers
Function
available_models
Returns the names of available CLIP models
CLIP_/clip/clip.py:88
↓ 1 callers
Function
basic_clean
(text)
CLIP_/clip/simple_tokenizer.py:56
↓ 1 callers
Method
bpe
(self, token)
CLIP_/clip/simple_tokenizer.py:92
↓ 1 callers
Method
build_attention_mask
(self)
CLIP_/clip/model.py:449
↓ 1 callers
Function
build_model
(state_dict: dict)
CLIP_/clip/model.py:525
↓ 1 callers
Function
calculate_ratio
Calculate aspect ratio from string.
src/models/nerf_mlp_multi.py:579
↓ 1 callers
Function
check_cuda
Verify CUDA is available for training.
scripts/train.py:46
↓ 1 callers
Method
clip_grads_colors
Apply gradient clipping to color parameters.
src/training/coach.py:923
↓ 1 callers
Method
clip_grads_points
Apply gradient clipping to point parameters.
src/training/coach.py:940
↓ 1 callers
Method
configure_loguru
Configure loguru logger settings.
src/training/logging/coach_logger.py:66
↓ 1 callers
Function
convert_weights
Convert applicable model parameters to fp16
CLIP_/clip/model.py:496
↓ 1 callers
Method
create_exp_dir
Create experiment directory structure.
src/training/coach.py:1024
↓ 1 callers
Method
create_polygon
( center: tuple[float, float], radius: float, num_edges: int )
src/models/painter.py:382
↓ 1 callers
Function
create_transform
Create transform pipeline for image preprocessing.
src/data/data_setups.py:22
next →
1–100 of 216, ranked by callers