learner
GrpcLearner(backend)
Bases: SupervisedLearner
, Model
Binding for an external learner using gRPC.
This learner class connects to an external learner using gRPC. Processed data for training or inference is sent to the learner and results are received from it.
Create a GrpcLearner.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
backend
|
_Backend
|
The backend to use for the learner. |
required |
Source code in src/flowcean/learners/grpc/learner.py
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 |
|
with_address(address)
classmethod
Create a GrpcLearner with a specific address.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
address
|
str
|
The address of the learner. |
required |
Returns:
Type | Description |
---|---|
Self
|
A GrpcLearner instance. |
Source code in src/flowcean/learners/grpc/learner.py
141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 |
|
run_docker(image, internal_port=8080, *, pull=True)
classmethod
Create a GrpcLearner running in a Docker container.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
image
|
str
|
The name of the Docker image to run. |
required |
internal_port
|
int
|
port the learner listens on inside the container. |
8080
|
pull
|
bool
|
Whether to pull the image from the registry. |
True
|
Returns:
Type | Description |
---|---|
Self
|
A GrpcLearner instance. |
Source code in src/flowcean/learners/grpc/learner.py
157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 |
|
__del__()
Close the gRPC channel.
Source code in src/flowcean/learners/grpc/learner.py
206 207 208 |
|