# SphereGridMixScaleSpatialRelationLocationEncoder Documentation ## Overview The `SphereGridMixScaleSpatialRelationLocationEncoder` is engineered for advanced spatial encoding, integrating a position encoder that leverages geometrically scaled sinusoidal functions. It processes these encodings through a multi-layer feed-forward neural network to create detailed spatial embeddings. ## Features - **Position Encoding (`self.position_encoder`)**: Uses the `SphereGridMixScaleSpatialRelationPositionEncoder` to perform multi-scale sinusoidal encoding of spatial differences. - **Feed-Forward Neural Network (`self.ffn`)**: Converts the position-encoded data into high-dimensional spatial embeddings through several neural network layers. ## Configuration Parameters - **spa_embed_dim**: The dimensionality of the spatial embeddings output. - **coord_dim**: The dimensionality of the coordinate space. - **frequency_num**: Number of frequency components used in positional encoding. - **max_radius**: Maximum spatial context radius the encoder can handle. - **min_radius**: Minimum radius for encoding, affecting the granularity of details captured. - **freq_init**: Frequency initialization method, set to 'geometric'. - **device**: Computation device, e.g., 'cuda'. - **ffn_act**: Activation function used in the neural network layers. - **ffn_num_hidden_layers**: Number of layers in the feed-forward network. - **ffn_dropout_rate**: Dropout rate to prevent overfitting. - **ffn_hidden_dim**: Dimension of each hidden layer in the network. - **ffn_use_layernormalize**: Flag to enable layer normalization in the network. - **ffn_skip_connection**: Flag to enable skip connections in the network. - **ffn_context_str**: Context string for detailed logging and debugging within the network. ## Methods ### `forward(coords)` Processes input coordinates through the location encoder to produce detailed spatial embeddings. - **Parameters**: - **coords** (List or np.ndarray): Coordinates to process, formatted as `(batch_size, num_context_pt, coord_dim)`. - **Returns**: - **sprenc** (Tensor): Spatial relation embeddings, shaped `(batch_size, num_context_pt, spa_embed_dim)`. > ## SphereGridMixScaleSpatialRelationPositionEncoder ### Overview This position encoder transforms spatial coordinates using a sophisticated sinusoidal encoding method, featuring multiple scales to capture a wide range of spatial details.