Source code for p2pfl.learning.frameworks.simulation
"""Module for the efficient parallel local simulation of the learning process (based on Ray)."""fromp2pfl.learning.frameworks.learnerimportLearnerfromp2pfl.utils.check_rayimportray_installed#### Ray###
[docs]deftry_init_learner_with_ray(learner:Learner)->Learner:""" Create a learner instance. Args: learner: The learner to wrap. """ifray_installed():fromp2pfl.learning.frameworks.simulation.virtual_learnerimportVirtualNodeLearnerlearner=VirtualNodeLearner(learner)returnlearner