Turi Create
4.0
|
#include <ml/neural_net/compute_context.hpp>
Classes | |
class | registration |
Public Types | |
using | factory = std::function< std::unique_ptr< compute_context >()> |
Public Member Functions | |
virtual void | print_training_device_info () const =0 |
virtual size_t | memory_budget () const =0 |
virtual std::unique_ptr< model_backend > | create_object_detector (int n, int c_in, int h_in, int w_in, int c_out, int h_out, int w_out, const float_array_map &config, const float_array_map &weights) |
virtual std::unique_ptr< model_backend > | create_activity_classifier (const ac_parameters &ac_params) |
virtual std::unique_ptr< model_backend > | create_style_transfer (const float_array_map &config, const float_array_map &weights) |
virtual std::unique_ptr< model_backend > | create_drawing_classifier (const float_array_map &weights, size_t batch_size, size_t num_classes) |
virtual std::unique_ptr< image_augmenter > | create_image_augmenter (const image_augmenter::options &opts) |
virtual std::unique_ptr< turi::neural_net::model_backend > | create_multilayer_perceptron_classifier (int n, int c_in, int c_out, const std::vector< size_t > &layer_sizes, const turi::neural_net::float_array_map &config) |
Static Public Member Functions | |
static std::unique_ptr< compute_context > | create () |
Interface for factories that produce concrete data augmentation and neural network module instances, used to abstract across backend implementations and hardware resources.
Definition at line 55 of file compute_context.hpp.
using turi::neural_net::compute_context::factory = std::function<std::unique_ptr<compute_context>()> |
Function that yields a compute context.
Definition at line 58 of file compute_context.hpp.
|
static |
Requests a compute_context from each registered compute_context::factory, in ascending order by "priority", until one returns non-nil. Factories should be registered so that this function yields a backend appropriate to the current platform and hardware.
|
inlinevirtual |
Creates an activity classification network.
Reimplemented in turi::neural_net::mps_compute_context, and turi::neural_net::tf_compute_context.
Definition at line 145 of file compute_context.hpp.
|
inlinevirtual |
Creates a drawing classification network.
Reimplemented in turi::neural_net::mps_compute_context, and turi::neural_net::tf_compute_context.
Definition at line 173 of file compute_context.hpp.
|
inlinevirtual |
Creates an image augmenter.
Reimplemented in turi::neural_net::mps_compute_context, and turi::neural_net::tf_compute_context.
Definition at line 182 of file compute_context.hpp.
|
inlinevirtual |
Creates a multilevel perceptron classifier.
Definition at line 191 of file compute_context.hpp.
|
inlinevirtual |
Creates an object detection network.
Reimplemented in turi::neural_net::mps_compute_context, and turi::neural_net::tf_compute_context.
Definition at line 129 of file compute_context.hpp.
|
inlinevirtual |
Creates a style transfer network
Reimplemented in turi::neural_net::mps_compute_context, and turi::neural_net::tf_compute_context.
Definition at line 158 of file compute_context.hpp.
|
pure virtual |
Provides a measure of the memory resources available.
Returns the maximum memory size in bytes that neural networks should allocate, typically used to determine batch sizes (often heuristically).
Implemented in turi::neural_net::mps_compute_context, and turi::neural_net::tf_compute_context.
|
pure virtual |
Prints (human readable) device information.
Implemented in turi::neural_net::mps_compute_context, and turi::neural_net::tf_compute_context.