Classes | Namespaces | Typedefs | Functions
program.h File Reference
#include "common.h"
#include <raft/core/handle.hpp>
#include <random>
Include dependency graph for program.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  cuml::genetic::program
 The main data structure to store the AST that represents a program in the current generation. More...
 

Namespaces

 cuml
 
 cuml::genetic
 

Typedefs

typedef program * cuml::genetic::program_t
 

Functions

void cuml::genetic::execute (const raft::handle_t &h, const program_t &d_progs, const int n_rows, const int n_progs, const float *data, float *y_pred)
 Calls the execution kernel to evaluate all programs on the given dataset. More...
 
void cuml::genetic::compute_metric (const raft::handle_t &h, int n_rows, int n_progs, const float *y, const float *y_pred, const float *w, float *score, const param &params)
 Compute the loss based on the metric specified in the training hyperparameters. It performs a batched computation for all programs in one shot. More...
 
void cuml::genetic::find_fitness (const raft::handle_t &h, program_t &d_prog, float *score, const param &params, const int n_rows, const float *data, const float *y, const float *sample_weights)
 Computes the fitness scores for a sngle program on the given dataset. More...
 
void cuml::genetic::find_batched_fitness (const raft::handle_t &h, int n_progs, program_t &d_progs, float *score, const param &params, const int n_rows, const float *data, const float *y, const float *sample_weights)
 Computes the fitness scores for all programs on the given dataset. More...
 
void cuml::genetic::set_fitness (const raft::handle_t &h, program_t &d_prog, program &h_prog, const param &params, const int n_rows, const float *data, const float *y, const float *sample_weights)
 Computes and sets the fitness scores for a single program on the given dataset. More...
 
void cuml::genetic::set_batched_fitness (const raft::handle_t &h, int n_progs, program_t &d_progs, std::vector< program > &h_progs, const param &params, const int n_rows, const float *data, const float *y, const float *sample_weights)
 Computes and sets the fitness scores for all programs on the given dataset. More...
 
float cuml::genetic::get_fitness (const program &prog, const param &params)
 Returns precomputed fitness score of program on the host, after accounting for parsimony. More...
 
int cuml::genetic::get_depth (const program &p_out)
 Evaluates and returns the depth of the current program. More...
 
void cuml::genetic::build_program (program &p_out, const param &params, std::mt19937 &rng)
 Build a random program with depth atmost 10. More...
 
void cuml::genetic::point_mutation (const program &prog, program &p_out, const param &params, std::mt19937 &rng)
 Perform a point mutation on the given program(AST) More...
 
void cuml::genetic::crossover (const program &prog, const program &donor, program &p_out, const param &params, std::mt19937 &rng)
 Perform a 'hoisted' crossover mutation using the parent and donor programs. The donor subtree selected is hoisted to ensure our constrains on total depth. More...
 
void cuml::genetic::subtree_mutation (const program &prog, program &p_out, const param &params, std::mt19937 &rng)
 Performs a crossover mutation with a randomly built new program. Since crossover is 'hoisted', this will ensure that depth constrains are not violated. More...
 
void cuml::genetic::hoist_mutation (const program &prog, program &p_out, const param &params, std::mt19937 &rng)
 Perform a hoist mutation on a random subtree of the given program (replace a subtree with a subtree of a subtree) More...