AnacletoLAB / grape

🍇 GRAPE is a Rust/Python Graph Representation Learning library for Predictions and Evaluations
MIT License
502 stars 38 forks source link

Node2VecSkipGramEnsmallen lacks num_walks parameter #48

Open abbynewbury opened 12 months ago

abbynewbury commented 12 months ago

Hi,

I am using the Node2VecSkipGramEnsmallen function and noticed that it does not take a num_walks parameter to represent the number of walks per node. The parameters that I see that are available are: mappingproxy({'embedding_size': <Parameter "embedding_size: int = 100">, 'epochs': <Parameter "epochs: int = 30">, 'clipping_value': <Parameter "clipping_value: float = 6.0">, 'number_of_negative_samples': <Parameter "number_of_negative_samples: int = 10">, 'walk_length': <Parameter "walk_length: int = 128">, 'iterations': <Parameter "iterations: int = 10">, 'window_size': <Parameter "window_size: int = 5">, 'return_weight': <Parameter "return_weight: float = 0.25">, 'explore_weight': <Parameter "explore_weight: float = 4.0">, 'max_neighbours': <Parameter "max_neighbours: Optional[int] = 100">, 'learning_rate': <Parameter "learning_rate: float = 0.01">, 'learning_rate_decay': <Parameter "learning_rate_decay: float = 0.9">, 'central_nodes_embedding_path': <Parameter "central_nodes_embedding_path: Optional[str] = None">, 'contextual_nodes_embedding_path': <Parameter "contextual_nodes_embedding_path: Optional[str] = None">, 'normalize_by_degree': <Parameter "normalize_by_degree: bool = False">, 'stochastic_downsample_by_degree': <Parameter "stochastic_downsample_by_degree: Optional[bool] = False">, 'normalize_learning_rate_by_degree': <Parameter "normalize_learning_rate_by_degree: Optional[bool] = False">, 'use_scale_free_distribution': <Parameter "use_scale_free_distribution: Optional[bool] = True">, 'random_state': <Parameter "random_state: int = 42">, 'dtype': <Parameter "dtype: str = 'f32'">, 'ring_bell': <Parameter "ring_bell: bool = False">, 'enable_cache': <Parameter "enable_cache: bool = False">, 'verbose': <Parameter "verbose: bool = True">}) I was wondering if iterations is the equivalent to num_walks? Thanks!

zommiommy commented 12 months ago

Hi! If I recall correctly, there is no equivalent of that parameter because we compute new random walks on the fly for instead of pre-computing them.

In our experiments this lead to better performance

LucaCappelletti94 commented 12 months ago

No, @zommiommy, the parameter @abbynewbury is looking for is the one called iterations.

abbynewbury commented 12 months ago

Okay, thank you!