Last active
December 20, 2019 16:06
-
-
Save deanwampler/9d1a500e7981b48b529c0228ee398c4c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import ray | |
@ray.remote | |
class ParameterServer(object): | |
def __init__(self, dim): | |
# Alternatively, params could be a dictionary | |
# mapping keys to arrays. | |
self.params = np.zeros(dim) | |
def get_params(self): | |
return self.params | |
def update_params(self, grad): | |
self.params += grad | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment