Skip to content

Instantly share code, notes, and snippets.

@deanwampler
Last active December 20, 2019 16:06
Show Gist options
  • Save deanwampler/9d1a500e7981b48b529c0228ee398c4c to your computer and use it in GitHub Desktop.
Save deanwampler/9d1a500e7981b48b529c0228ee398c4c to your computer and use it in GitHub Desktop.
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