caffeinterface
Class CaffeClient

java.lang.Object
  extended by caffeinterface.CaffeClient
All Implemented Interfaces:
com.google.protobuf.RpcCallback<ComputeServiceProtos.Matrix>

public class CaffeClient
extends java.lang.Object
implements com.google.protobuf.RpcCallback<ComputeServiceProtos.Matrix>

Provides functionality to run CAFFE classes in client-server mode. This is the client side of things.

Author:
dgorur

Field Summary
static java.lang.String DEFAULT_HOST
          The default host is localhost.
static int DEFAULT_PORT
          The default port.
 
Constructor Summary
CaffeClient()
          Creates a CaffeClient to connect to the default port on localhost.
CaffeClient(java.lang.String host)
          Creates a CaffeClient to connect to the requested hosted host using the default port.
CaffeClient(java.lang.String host, int port)
          Creates a CaffeClient to connect to the requested host on the requested port.
 
Method Summary
 void compute(cern.colt.matrix.DoubleMatrix2D x, cern.colt.matrix.DoubleMatrix2D y)
          Calls the Compute#compute(RpcController, Matrix, RpcCallback) method on the CAFFE class service hosted remotely.
static void main(java.lang.String[] args)
           
 void run(ComputeServiceProtos.Matrix parameter)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_HOST

public static final java.lang.String DEFAULT_HOST
The default host is localhost. If you want to change this default, create a subclass, but this class provides a constructor argument to listen on another port. That's the preferred method.

See Also:
Constant Field Values

DEFAULT_PORT

public static final int DEFAULT_PORT
The default port. Similar to default host.

See Also:
Constant Field Values
Constructor Detail

CaffeClient

public CaffeClient()
Creates a CaffeClient to connect to the default port on localhost.


CaffeClient

public CaffeClient(java.lang.String host)
Creates a CaffeClient to connect to the requested hosted host using the default port.

Parameters:
host - the requested host.

CaffeClient

public CaffeClient(java.lang.String host,
                   int port)
Creates a CaffeClient to connect to the requested host on the requested port.

Parameters:
host - the specified host.
port - the specified port.
Method Detail

main

public static void main(java.lang.String[] args)

compute

public void compute(cern.colt.matrix.DoubleMatrix2D x,
                    cern.colt.matrix.DoubleMatrix2D y)
Calls the Compute#compute(RpcController, Matrix, RpcCallback) method on the CAFFE class service hosted remotely.

Parameters:
x - the matrix of inputs, row-wise.
y - the matrix to store the results, again row-wise.

run

public void run(ComputeServiceProtos.Matrix parameter)
Specified by:
run in interface com.google.protobuf.RpcCallback<ComputeServiceProtos.Matrix>