client.go 1.5 KB
Newer Older
1 2
package pserver

H
Helin Wang 已提交
3
// Client is the client to parameter servers.
4 5 6
type Client struct {
}

H
Helin Wang 已提交
7
// NewClient creates a new client.
8 9 10 11
func NewClient(addr string) *Client {
	return &Client{}
}

H
Helin Wang 已提交
12 13 14 15 16 17 18 19 20
// BeginInitParams begins to initialize parameters on parameter
// servers.
//
// BeginInitParams will be called from multiple trainers, only one
// trainer will be selected to initialize the parameters on parameter
// servers. Other trainers will be blocked until the initialization is
// done, and they need to get the initialized parameters from
// parameter servers using GetParams.
func (c *Client) BeginInitParams(pserverConfigProto []byte) (selected bool, err error) {
21 22 23
	return true, nil
}

H
Helin Wang 已提交
24
// InitParam initializes the parameter on parameter servers.
25 26 27 28
func (c *Client) InitParam(paramWithConfigs ParameterWithConfig) error {
	return nil
}

H
Helin Wang 已提交
29 30
// FinishInitParams tells parameter servers client has sent all
// parameters to parameter servers as initialization.
31 32 33 34
func (c *Client) FinishInitParams() error {
	return nil
}

H
Helin Wang 已提交
35 36
// SendGrads sends gradients to parameter servers for updating
// parameters.
37 38 39 40
func (c *Client) SendGrads(grads []Gradient) error {
	return nil
}

H
Helin Wang 已提交
41
// GetParams gets parameters from parameter servers.
42 43 44 45
func (c *Client) GetParams(names []string) ([]Parameter, error) {
	return nil, nil
}

H
Helin Wang 已提交
46 47
// SaveModel indicates parameters to save the parameter to the given
// path.
48 49 50 51
func (c *Client) SaveModel(path string) error {
	return nil
}

H
Helin Wang 已提交
52
// Cleanup cleans up the client states.
53 54
func (c *Client) Cleanup() {
}