NeuralEngine
A Game Engine with embeded Machine Learning algorithms based on Gaussian Processes.
FgKMeans.h
1
11#pragma once
12
13#include <NeMachineLearningLib.h>
14#include <MachineLearning/CommonUtil.h>
15
16namespace NeuralEngine
17{
18 namespace MachineLearning
19 {
69 template<typename Scalar>
70 class NE_IMPEXP KMeans
71 {
72 public:
73
85 static void Compute(af::array& means, af::array& clusters, const af::array& in, int k, int iter = 100);
86
87 private:
88
99 static af::array Clusterize(const af::array& data, const af::array& means);
100
112 static af::array NewMeans(af::array data, af::array clusters, int k);
113
124 static af::array Distance(const af::array& data, const af::array& means);
125 };
126 }
127}
static af::array Clusterize(const af::array &data, const af::array &means)
Associates data to computed means.
static af::array Distance(const af::array &data, const af::array &means)
Euclidian distance.
static void Compute(af::array &means, af::array &clusters, const af::array &in, int k, int iter=100)
Computes k means and cluster.
static af::array NewMeans(af::array data, af::array clusters, int k)
Creates a new means.