all interface unified with C++ code and style

nix
Pierre Alexandre Tremblay 6 years ago
parent a56de773d2
commit 13af5e9c6e

@ -41,8 +41,8 @@ FluidDataSetQuery : FluidManipulationClient {
this.prSendMsg(\limit, [rows], action); this.prSendMsg(\limit, [rows], action);
} }
transform{|sourceDataset, destDataset, action| transform{|sourceDataSet, destDataSet, action|
this.prSendMsg(\transform,[sourceDataset.asSymbol, destDataset.asSymbol],action); this.prSendMsg(\transform,[sourceDataSet.asSymbol, destDataSet.asSymbol],action);
} }
} }

@ -9,7 +9,7 @@ FluidKDTree : FluidDataClient {
var values = [numNeighbours] ++ this.prServerString(lookupDataSet.asSymbol); var values = [numNeighbours] ++ this.prServerString(lookupDataSet.asSymbol);
var params = [names,values].lace; var params = [names,values].lace;
/* env = Environment(); /* env = Environment();
synthControls[1..].do{|x| synthControls[1..].do{|x|
@ -17,14 +17,13 @@ FluidKDTree : FluidDataClient {
}; };
env.put(\numNeighbours,1); */ env.put(\numNeighbours,1); */
^super.new1(server,params); ^super.new1(server,params);
/* env, /* env,
[\numNeighbours]++lookupDataSet); */ [\numNeighbours]++lookupDataSet); */
} }
fit{|dataset,action| fit{|dataSet,action|
dataset.asSymbol.postln; this.prSendMsg(\fit, [dataSet.asSymbol], action);
this.prSendMsg(\fit, [dataset.asSymbol], action);
} }
kNearest{ |buffer, action| kNearest{ |buffer, action|

@ -1,26 +1,26 @@
FluidKMeans : FluidDataClient { FluidKMeans : FluidDataClient {
*new {|server, numClusters = 4, maxIter = 100| *new {|server, numClusters = 4, maxIter = 100|
^super.new1(server,[\numClusters,numClusters,\maxIter,maxIter]); ^super.new1(server,[\numClusters,numClusters,\maxIter,maxIter]);
} }
fit{|dataset,action| fit{|dataSet,action|
this.prSendMsg(\fit, this.prSendMsg(\fit,
[dataset.asSymbol], action, [dataSet.asSymbol], action,
[numbers(FluidMessageResponse,_,this.numClusters,_)] [numbers(FluidMessageResponse,_,this.numClusters,_)]
); );
} }
fitPredict{|dataset, labelset,action| fitPredict{|dataSet, labelSet,action|
this.prSendMsg(\fitPredict, this.prSendMsg(\fitPredict,
[dataset.asSymbol,labelset.asSymbol], [dataSet.asSymbol,labelSet.asSymbol],
action,[numbers(FluidMessageResponse,_,this.numClusters,_)] action,[numbers(FluidMessageResponse,_,this.numClusters,_)]
); );
} }
predict{ |dataset, labelset,action| predict{ |dataSet, labelSet,action|
this.prSendMsg(\predict, this.prSendMsg(\predict,
[dataset.asSymbol, labelset.asSymbol], action, [dataSet.asSymbol, labelSet.asSymbol], action,
[numbers(FluidMessageResponse,_,this.numClusters,_)] [numbers(FluidMessageResponse,_,this.numClusters,_)]
); );
} }

@ -4,13 +4,13 @@ FluidKNNClassifier : FluidDataClient {
^super.new1(server,[\numNeighbours,numNeighbours,\weight,weight]); ^super.new1(server,[\numNeighbours,numNeighbours,\weight,weight]);
} }
fit{|dataset, labelset, action| fit{|dataSet, labelSet, action|
this.prSendMsg(\fit,[dataset.asSymbol, labelset.asSymbol], action); this.prSendMsg(\fit,[dataSet.asSymbol, labelSet.asSymbol], action);
} }
predict{|dataset, labelset, action| predict{|dataSet, labelSet, action|
this.prSendMsg(\predict, this.prSendMsg(\predict,
[dataset.asSymbol, labelset.asSymbol], [dataSet.asSymbol, labelSet.asSymbol],
action); action);
} }

@ -4,16 +4,16 @@ FluidKNNRegressor : FluidDataClient {
^super.new1(server,[\numNeighbours,numNeighbours,\weight,weight]); ^super.new1(server,[\numNeighbours,numNeighbours,\weight,weight]);
} }
fit{|sourceDataset, targetDataset, action| fit{|sourceDataSet, targetDataSet, action|
this.prSendMsg(\fit, this.prSendMsg(\fit,
[sourceDataset.asSymbol, targetDataset.asSymbol], [sourceDataSet.asSymbol, targetDataSet.asSymbol],
action action
); );
} }
predict{ |sourceDataset, targetDataset,action| predict{ |sourceDataSet, targetDataSet,action|
this.prSendMsg(\predict, this.prSendMsg(\predict,
[sourceDataset.asSymbol, targetDataset.asSymbol], [sourceDataSet.asSymbol, targetDataSet.asSymbol],
action); action);
} }

@ -16,9 +16,9 @@ FluidMDS : FluidManipulationClient {
id = uid; id = uid;
} }
fitTransform{|sourceDataset, destDataset, k, dist, action| fitTransform{|sourceDataSet, destDataSet, numDimensions, distanceMetric, action|
this.prSendMsg(\fitTransform, this.prSendMsg(\fitTransform,
[sourceDataset.asSymbol, destDataset.asSymbol, k, dist], action); [sourceDataSet.asSymbol, destDataSet.asSymbol, numDimensions, distanceMetric], action);
} }
// not implemented // not implemented

@ -15,16 +15,16 @@ FluidMLPRegressor : FluidManipulationClient {
id = uid; id = uid;
} }
fit{|sourceDataset, targetDataset, action| fit{|sourceDataSet, targetDataSet, action|
this.prSendMsg(\fit, this.prSendMsg(\fit,
[sourceDataset.asSymbol, targetDataset.asSymbol], [sourceDataSet.asSymbol, targetDataSet.asSymbol],
action,numbers(FluidMessageResponse,_,1,_) action,numbers(FluidMessageResponse,_,1,_)
); );
} }
predict{ |sourceDataset, targetDataset, layer, action| predict{ |sourceDataSet, targetDataSet, layer, action|
this.prSendMsg(\predict, this.prSendMsg(\predict,
[sourceDataset.asSymbol, targetDataset.asSymbol,layer], [sourceDataSet.asSymbol, targetDataSet.asSymbol,layer],
action); action);
} }

@ -4,19 +4,19 @@ FluidNormalize : FluidDataClient {
^super.new1(server,[\min,min,\max,max]); ^super.new1(server,[\min,min,\max,max]);
} }
fit{|dataset, action| fit{|dataSet, action|
this.prSendMsg(\fit,[dataset.asSymbol], action); this.prSendMsg(\fit,[dataSet.asSymbol], action);
} }
transform{|sourceDataset, destDataset, action| transform{|sourceDataSet, destDataSet, action|
this.prSendMsg(\transform, this.prSendMsg(\transform,
[sourceDataset.asSymbol, destDataset.asSymbol], action [sourceDataSet.asSymbol, destDataSet.asSymbol], action
); );
} }
fitTransform{|sourceDataset, destDataset, action| fitTransform{|sourceDataSet, destDataSet, action|
this.prSendMsg(\fitTransform, this.prSendMsg(\fitTransform,
[sourceDataset.asSymbol, destDataset.asSymbol], action [sourceDataSet.asSymbol, destDataSet.asSymbol], action
); );
} }

@ -4,16 +4,16 @@ FluidPCA : FluidDataClient {
^super.new1(server,[\numDimensions,numDimensions]); ^super.new1(server,[\numDimensions,numDimensions]);
} }
fit{|dataset, action| fit{|dataSet, action|
this.prSendMsg(\fit,[dataset.asSymbol], action); this.prSendMsg(\fit,[dataSet.asSymbol], action);
} }
transform{|sourceDataset, destDataset, action| transform{|sourceDataSet, destDataSet, action|
this.prSendMsg(\transform,[sourceDataset.asSymbol, destDataset.asSymbol], action); this.prSendMsg(\transform,[sourceDataSet.asSymbol, destDataSet.asSymbol], action);
} }
fitTransform{|sourceDataset, destDataset, action| fitTransform{|sourceDataSet, destDataSet, action|
this.prSendMsg(\fitTransform,[sourceDataset.asSymbol, destDataset.asSymbol], action); this.prSendMsg(\fitTransform,[sourceDataSet.asSymbol, destDataSet.asSymbol], action);
} }

@ -1,17 +1,17 @@
FluidStandardize : FluidDataClient { FluidStandardize : FluidDataClient {
fit{|dataset, action| fit{|dataSet, action|
this.prSendMsg(\fit, [dataset.asSymbol], action); this.prSendMsg(\fit, [dataSet.asSymbol], action);
} }
transform{|sourceDataset, destDataset, action| transform{|sourceDataSet, destDataSet, action|
this.prSendMsg(\transform, this.prSendMsg(\transform,
[sourceDataset.asSymbol, destDataset.asSymbol], action [sourceDataSet.asSymbol, destDataSet.asSymbol], action
); );
} }
fitTransform{|sourceDataset, destDataset, action| fitTransform{|sourceDataSet, destDataSet, action|
this.prSendMsg(\fitTransform, this.prSendMsg(\fitTransform,
[sourceDataset.asSymbol, destDataset.asSymbol], action [sourceDataSet.asSymbol, destDataSet.asSymbol], action
); );
} }

@ -11,12 +11,12 @@ CLASSMETHODS::
PRIVATE:: asUGenInput PRIVATE:: asUGenInput
METHOD:: new METHOD:: new
Create a new instance of the dataset, with the given name. If a Dataset with this name already exists, an exception will be thrown (see link::Classes/FluidDataSet#at:: to access an extant Dataset). Create a new instance of the DataSet, with the given name. If a DataSet with this name already exists, an exception will be thrown (see link::Classes/FluidDataSet#at:: to access an existant DataSet).
ARGUMENT:: server ARGUMENT:: server
The link::Classes/Server:: on which to create the data set. The link::Classes/Server:: on which to create the data set.
ARGUMENT:: name ARGUMENT:: name
A symbol with the name of the dataset. A symbol with the name of the DataSet.
returns:: The new instance returns:: The new instance
@ -24,9 +24,9 @@ METHOD:: at
Retrieves a cached instance of a FluidDataSet with the given name, or returns nil if no such object exists. Retrieves a cached instance of a FluidDataSet with the given name, or returns nil if no such object exists.
ARGUMENT:: server ARGUMENT:: server
The server associated with this dataset instance. The server associated with this DataSet instance.
ARGUMENT:: name ARGUMENT:: name
The name of the Dataset to retrieve from the cache. The name of the DataSet to retrieve from the cache.
INSTANCEMETHODS:: INSTANCEMETHODS::
@ -34,8 +34,8 @@ INSTANCEMETHODS::
PRIVATE:: init,id,cache PRIVATE:: init,id,cache
METHOD:: addPoint METHOD:: addPoint
Add a new point to the data set. The dimensionality of the dataset is governed by the size of the first point added. Add a new point to the data set. The dimensionality of the DataSet is governed by the size of the first point added.
Will report an error if the label already exists, or if the size of the data does not match the dimensionality of the dataset. Will report an error if the label already exists, or if the size of the data does not match the dimensionality of the DataSet.
ARGUMENT:: label ARGUMENT:: label
A symbol or string with the label for the new point. A symbol or string with the label for the new point.
ARGUMENT:: buffer ARGUMENT:: buffer
@ -44,7 +44,7 @@ ARGUMENT:: action
A function to run when the point has been added. A function to run when the point has been added.
METHOD:: updatePoint METHOD:: updatePoint
Update an existing label's data. Will report an error if the label doesn't exist, or if the size of the data does not match the given dimensionality of the dataset. Update an existing label's data. Will report an error if the label doesn't exist, or if the size of the data does not match the given dimensionality of the DataSet.
METHOD:: getPoint METHOD:: getPoint
Retrieve a point from the data set into a link::Classes/Buffer::. Will report an error if the label or buffer doesn't exist. Retrieve a point from the data set into a link::Classes/Buffer::. Will report an error if the label or buffer doesn't exist.
@ -59,7 +59,7 @@ METHOD:: free
Destroy the object on the server. Destroy the object on the server.
METHOD:: print METHOD:: print
Post an abbreviated content of the dataset in the window by default, but you can supply a custom action instead. Post an abbreviated content of the DataSet in the window by default, but you can supply a custom action instead.
METHOD:: synth METHOD:: synth
The internal synth the object uses to communicate with the server The internal synth the object uses to communicate with the server

@ -84,10 +84,10 @@ Run when done
METHOD:: transform METHOD:: transform
Apply the query to a source link::Classes/FluidDataSet:: and write to a destination. Can be the same. Apply the query to a source link::Classes/FluidDataSet:: and write to a destination. Can be the same.
ARGUMENT:: sourceDataset ARGUMENT:: sourceDataSet
Source data, or the dataset name Source data, or the DataSet name
ARGUMENT:: destDataset ARGUMENT:: destDataSet
Destination data, or the dataset name Destination data, or the DataSet name
ARGUMENT:: action ARGUMENT:: action
Run when done Run when done
@ -99,19 +99,19 @@ code::
s.boot; s.boot;
// Create a dataset with random data // Create a DataSet with random data
~dataset= FluidDataSet(s,\help_fluid_dataset_query); ~dataSet= FluidDataSet(s,\help_fluid_dataset_query);
( (
~points = 100.collect{24.collect{100.rand}}; ~points = 100.collect{24.collect{100.rand}};
~dataset.clear; ~dataSet.clear;
~tmpbuf = Buffer.alloc(s,24); ~tmpbuf = Buffer.alloc(s,24);
fork{ fork{
s.sync; s.sync;
~points.do{|x,i| ~points.do{|x,i|
~tmpbuf.setn(0,x); ~tmpbuf.setn(0,x);
~dataset.addPoint(i,~tmpbuf); ~dataSet.addPoint(i,~tmpbuf);
s.sync s.sync
} }
} }
@ -128,12 +128,12 @@ fork{
~query.and(2,"<",50); ~query.and(2,"<",50);
~query.limit(10); ~query.limit(10);
// Create an output dataset and run the query // Create an output DataSet and run the query
~out = FluidDataSet(s,\help_fluid_dataset_query_out); ~out = FluidDataSet(s,\help_fluid_dataset_query_out);
~query.transform(~dataset, ~out); ~query.transform(~dataSet, ~out);
// Check the results // Check the results
~dataset.print; ~dataSet.print;
~out.print; ~out.print;

@ -23,7 +23,7 @@ INSTANCEMETHODS::
METHOD:: fit METHOD:: fit
Build the tree by scanning the points of a LINK::Classes/FluidDataSet:: Build the tree by scanning the points of a LINK::Classes/FluidDataSet::
ARGUMENT:: dataset ARGUMENT:: dataSet
The LINK::Classes/FluidDataSet:: of interest. This can either be a data set object itself, or the name of one. The LINK::Classes/FluidDataSet:: of interest. This can either be a data set object itself, or the name of one.
ARGUMENT:: action ARGUMENT:: action
A function to run when indexing is complete. A function to run when indexing is complete.
@ -48,7 +48,7 @@ EXAMPLES::
code:: code::
// Make a dataset of random 23D points // Make a DataSet of random 23D points
s.boot; s.boot;
( (
fork{ fork{
@ -61,10 +61,10 @@ fork{
} }
) )
// Make a new tree, and fit it to the dataset // Make a new tree, and fit it to the DataSet
~tree = FluidKDTree(s,numNeighbours:5,lookupDataSet:~ds); ~tree = FluidKDTree(s,numNeighbours:5,lookupDataSet:~ds);
//Fit it to the dataset //Fit it to the DataSet
~tree.fit(~ds); ~tree.fit(~ds);
// Should be 100 points, 2 columns // Should be 100 points, 2 columns

@ -26,25 +26,25 @@ PRIVATE::k
METHOD:: fit METHOD:: fit
Identify code::k:: clusters in a link::Classes/FluidDataSet:: Identify code::k:: clusters in a link::Classes/FluidDataSet::
ARGUMENT:: dataset ARGUMENT:: dataSet
A link::Classes/FluidDataSet:: of data points. A link::Classes/FluidDataSet:: of data points.
ARGUMENT:: action ARGUMENT:: action
A function to run when fitting is complete, taking as its argument an array with the number of data points for each cluster. A function to run when fitting is complete, taking as its argument an array with the number of data points for each cluster.
METHOD:: predict METHOD:: predict
Given a trained object, return the cluster ID for each data point in a dataset to a label set. Given a trained object, return the cluster ID for each data point in a DataSet to a label set.
ARGUMENT:: dataset ARGUMENT:: dataSet
a link::Classes/FluidDataSet:: containing the data to predict. a link::Classes/FluidDataSet:: containing the data to predict.
ARGUMENT:: labelset ARGUMENT:: labelSet
a link::Classes/FluidLabelSet:: to retrieve the predicted clusters. a link::Classes/FluidLabelSet:: to retrieve the predicted clusters.
ARGUMENT:: action ARGUMENT:: action
A function to run when the server responds. A function to run when the server responds.
METHOD:: fitPredict METHOD:: fitPredict
Run link::Classes/FluidKMeans#*fit:: and link::Classes/FluidKMeans#*predict:: in a single pass: i.e. train the model on the incoming link::Classes/FluidDataSet:: and then return the learned clustering to the passed link::Classes/FluidLabelSet:: Run link::Classes/FluidKMeans#*fit:: and link::Classes/FluidKMeans#*predict:: in a single pass: i.e. train the model on the incoming link::Classes/FluidDataSet:: and then return the learned clustering to the passed link::Classes/FluidLabelSet::
ARGUMENT:: dataset ARGUMENT:: dataSet
a link::Classes/FluidDataSet:: containing the data to fit and predict. a link::Classes/FluidDataSet:: containing the data to fit and predict.
ARGUMENT:: labelset ARGUMENT:: labelSet
a link::Classes/FluidLabelSet:: to retrieve the predicted clusters. a link::Classes/FluidLabelSet:: to retrieve the predicted clusters.
ARGUMENT:: action ARGUMENT:: action
A function to run when the server responds A function to run when the server responds
@ -58,9 +58,9 @@ A function to run when the server responds, taking the ID of the cluster as its
METHOD:: predict METHOD:: predict
Report cluster assignments for previously unseen data. Report cluster assignments for previously unseen data.
ARGUMENT:: dataset ARGUMENT:: dataSet
A link::Classes/FluidDataSet:: of data points. A link::Classes/FluidDataSet:: of data points.
ARGUMENT:: labelset ARGUMENT:: labelSet
A link::Classes/FluidLabelSet:: to contain assignments. A link::Classes/FluidLabelSet:: to contain assignments.
ARGUMENT:: action ARGUMENT:: action
A function to run when complete, taking an array of the counts for each category as its argument. A function to run when complete, taking an array of the counts for each category as its argument.
@ -71,17 +71,17 @@ Server.default.options.outDevice = "Built-in Output"
code:: code::
( (
//Make some clumped 2D points and place into a dataset //Make some clumped 2D points and place into a DataSet
~points = (4.collect{ ~points = (4.collect{
64.collect{(1.sum3rand) + [1,-1].choose}.clump(2) 64.collect{(1.sum3rand) + [1,-1].choose}.clump(2)
}).flatten(1) * 0.5; }).flatten(1) * 0.5;
fork{ fork{
~dataset = FluidDataSet.new(s,\kmeans_help_rand2d); ~dataSet = FluidDataSet.new(s,\kmeans_help_rand2d);
d = Dictionary.with( d = Dictionary.with(
*[\cols -> 2,\data -> Dictionary.newFrom( *[\cols -> 2,\data -> Dictionary.newFrom(
~points.collect{|x, i| [i, x]}.flatten)]); ~points.collect{|x, i| [i, x]}.flatten)]);
s.sync; s.sync;
~dataset.load(d, {~dataset.print}); ~dataSet.load(d, {~dataSet.print});
} }
) )
@ -92,7 +92,7 @@ fork{
// Fit into 4 clusters // Fit into 4 clusters
( (
~kmeans.fitPredict(~dataset,~clusters,action: {|c| ~kmeans.fitPredict(~dataSet,~clusters,action: {|c|
"Fitted.\n # Points in each cluster:".postln; "Fitted.\n # Points in each cluster:".postln;
c.do{|x,i| c.do{|x,i|
("Cluster" + i + "->" + x.asInteger + "points").postln; ("Cluster" + i + "->" + x.asInteger + "points").postln;
@ -100,7 +100,7 @@ fork{
}); });
) )
// Cols of kmeans should match dataset, size is the number of clusters // Cols of kmeans should match DataSet, size is the number of clusters
~kmeans.cols; ~kmeans.cols;
~kmeans.size; ~kmeans.size;
~kmeans.dump; ~kmeans.dump;

@ -22,18 +22,18 @@ INSTANCEMETHODS::
METHOD:: fit METHOD:: fit
Fit the model to a source link::Classes/FluidDataSet:: and a target link::Classes/FluidLabelSet::. These need to be the same size Fit the model to a source link::Classes/FluidDataSet:: and a target link::Classes/FluidLabelSet::. These need to be the same size
ARGUMENT:: dataset ARGUMENT:: dataSet
Source data Source data
ARGUMENT:: labelset ARGUMENT:: labelSet
Labels for the source data Labels for the source data
ARGUMENT:: action ARGUMENT:: action
Run when done Run when done
METHOD:: predict METHOD:: predict
Given a fitted model, predict labels for a link::Classes/FluidDataSet:: and write these to a link::Classes/FluidLabelSet:: Given a fitted model, predict labels for a link::Classes/FluidDataSet:: and write these to a link::Classes/FluidLabelSet::
ARGUMENT:: dataset ARGUMENT:: dataSet
data to predict labels for data to predict labels for
ARGUMENT:: labelset ARGUMENT:: labelSet
place to write labels place to write labels
ARGUMENT:: action ARGUMENT:: action
Run when done Run when done
@ -52,8 +52,8 @@ code::
// Make: // Make:
// - A KNN Classifier // - A KNN Classifier
// - A dataset of example points, and a label set of corresponding labels // - A DataSet of example points, and a label set of corresponding labels
// - A dataset of test data and a labelset for predicted labels // - A DataSet of test data and a LabelSet for predicted labels
( (
~classifier = FluidKNNClassifier(s); ~classifier = FluidKNNClassifier(s);
@ -63,7 +63,7 @@ code::
~mapping = FluidLabelSet(s,\knnclassify_help_mapping); ~mapping = FluidLabelSet(s,\knnclassify_help_mapping);
) )
//Make some clumped 2D points and place into a dataset //Make some clumped 2D points and place into a DataSet
( (
~examplepoints = [[0.5,0.5],[-0.5,0.5],[0.5,-0.5],[-0.5,-0.5]]; ~examplepoints = [[0.5,0.5],[-0.5,0.5],[0.5,-0.5],[-0.5,-0.5]];
~examplelabels = [\red,\orange,\green,\blue]; ~examplelabels = [\red,\orange,\green,\blue];
@ -87,7 +87,7 @@ d = Dictionary.with(
) )
//Fit the classifier to the example dataset and labels, and then run prediction on the test data into our mapping label set //Fit the classifier to the example DataSet and labels, and then run prediction on the test data into our mapping label set
( (
~classifier.fit(~source,~labels); ~classifier.fit(~source,~labels);
~classifier.predict(~test, ~mapping, 1); ~classifier.predict(~test, ~mapping, 1);
@ -193,6 +193,3 @@ code::
}.play(~classifier.synth,addAction:\addAfter); }.play(~classifier.synth,addAction:\addAfter);
) )
:: ::

@ -22,20 +22,20 @@ Whether to weight neighbours by distance when producing new point
INSTANCEMETHODS:: INSTANCEMETHODS::
METHOD:: fit METHOD:: fit
Map a source link::Classes/FluidDataSet:: to a one-dimensional target; both datasets need to have the same number of points. Map a source link::Classes/FluidDataSet:: to a one-dimensional target; both DataSets need to have the same number of points.
ARGUMENT:: sourceDataset ARGUMENT:: sourceDataSet
Source data Source data
ARGUMENT:: targetDataset ARGUMENT:: targetDataSet
Target data Target data
ARGUMENT:: action ARGUMENT:: action
Run when done Run when done
METHOD:: predict METHOD:: predict
Apply learned mapping to a link::Classes/FluidDataSet:: and write to an output dataset Apply learned mapping to a link::Classes/FluidDataSet:: and write to an output DataSet
ARGUMENT:: sourceDataset ARGUMENT:: sourceDataSet
data to regress data to regress
ARGUMENT:: targetDataset ARGUMENT:: targetDataSet
output data output data
ARGUMENT:: action ARGUMENT:: action
Run when done Run when done

@ -45,13 +45,13 @@ PRIVATE:: init
METHOD:: fitTransform METHOD:: fitTransform
Fit the model to a link::Classes/FluidDataSet:: and write the new projected data to a destination FluidDataSet. Fit the model to a link::Classes/FluidDataSet:: and write the new projected data to a destination FluidDataSet.
ARGUMENT:: sourceDataset ARGUMENT:: sourceDataSet
Source data, or the dataset name Source data, or the DataSet name
ARGUMENT:: destDataset ARGUMENT:: destDataSet
Destination data, or the dataset name Destination data, or the DataSet name
ARGUMENT:: k ARGUMENT:: numDimensions
The number of dimensions to reduce to The number of dimensions to reduce to
ARGUMENT:: dist ARGUMENT:: distanceMetric
The distance metric to use (integer, 0-6, see flags above) The distance metric to use (integer, 0-6, see flags above)
ARGUMENT:: action ARGUMENT:: action
Run when done Run when done
@ -105,9 +105,9 @@ FluidBufMFCC.process(s,~audio, features: ~mfcc_feature);
//First standardize our dataset, so that the MFCC dimensions are on comensurate scales //First standardize our DataSet, so that the MFCC dimensions are on comensurate scales
//Then apply the MDS in-place on the standardized data to get 2 dimensions, using a Euclidean distance metric //Then apply the MDS in-place on the standardized data to get 2 dimensions, using a Euclidean distance metric
//Download the dataset contents into an array for plotting //Download the DataSet contents into an array for plotting
( (
~reducedarray = Array.new(100); ~reducedarray = Array.new(100);
~standardizer.fitTransform(~raw, ~standardized); ~standardizer.fitTransform(~raw, ~standardized);

@ -42,10 +42,10 @@ PRIVATE:: init, uid
METHOD:: fit METHOD:: fit
Train the network to map between a source and target link::Classes/FluidDataSet:: Train the network to map between a source and target link::Classes/FluidDataSet::
ARGUMENT:: sourceDataset ARGUMENT:: sourceDataSet
Source data Source data
ARGUMENT:: targetDataset ARGUMENT:: targetDataSet
Target data Target data
ARGUMENT:: action ARGUMENT:: action
@ -54,12 +54,12 @@ Function to run when training is complete
returns:: The training loss, or -1 if training failed returns:: The training loss, or -1 if training failed
METHOD:: predict METHOD:: predict
Apply the learned mapping to a dataset (given a trained network) Apply the learned mapping to a DataSet (given a trained network)
ARGUMENT:: sourceDataset ARGUMENT:: sourceDataSet
Input data Input data
ARGUMENT:: targetDataset ARGUMENT:: targetDataSet
Output data Output data
ARGUMENT:: layer ARGUMENT:: layer

@ -26,16 +26,16 @@ INSTANCEMETHODS::
METHOD:: fit METHOD:: fit
Compute the normalization factors from a link::Classes/FluidDataSet:: for later. Compute the normalization factors from a link::Classes/FluidDataSet:: for later.
ARGUMENT:: dataset ARGUMENT:: dataSet
The link::Classes/FluidDataSet:: to normalize The link::Classes/FluidDataSet:: to normalize
ARGUMENT:: action ARGUMENT:: action
A function to run when processing is complete A function to run when processing is complete
METHOD:: transform METHOD:: transform
Normalize a link::Classes/FluidDataSet:: into another link::Classes/FluidDataSet::, using the learned extrema from a previous call to link::Classes/FluidNormalize#fit:: Normalize a link::Classes/FluidDataSet:: into another link::Classes/FluidDataSet::, using the learned extrema from a previous call to link::Classes/FluidNormalize#fit::
ARGUMENT:: sourceDataset ARGUMENT:: sourceDataSet
The link::Classes/FluidDataSet:: to normalize The link::Classes/FluidDataSet:: to normalize
ARGUMENT:: destDataset ARGUMENT:: destDataSet
The link::Classes/FluidDataSet:: to populate with normalized data The link::Classes/FluidDataSet:: to populate with normalized data
ARGUMENT:: action ARGUMENT:: action
A function to run when processing is complete A function to run when processing is complete
@ -43,9 +43,9 @@ A function to run when processing is complete
METHOD:: fitTransform METHOD:: fitTransform
Normalize a link::Classes/FluidDataSet:: Normalize a link::Classes/FluidDataSet::
ARGUMENT:: sourceDataset ARGUMENT:: sourceDataSet
The link::Classes/FluidDataSet:: to normalize The link::Classes/FluidDataSet:: to normalize
ARGUMENT:: destDataset ARGUMENT:: destDataSet
The link::Classes/FluidDataSet:: to populate with normalized data The link::Classes/FluidDataSet:: to populate with normalized data
ARGUMENT:: action ARGUMENT:: action
A function to run when processing is complete A function to run when processing is complete

@ -24,26 +24,26 @@ PRIVATE:: init
METHOD:: fit METHOD:: fit
Train this model on a link::Classes/FluidDataSet:: but don't transform the data Train this model on a link::Classes/FluidDataSet:: but don't transform the data
ARGUMENT:: dataset ARGUMENT:: dataSet
A link::Classes/FluidDataSet:: to analyse A link::Classes/FluidDataSet:: to analyse
ARGUMENT:: action ARGUMENT:: action
Run when done Run when done
METHOD:: transform METHOD:: transform
Given a trained model, apply the reduction to a source link::Classes/FluidDataSet:: and write to a destination. Can be the same Given a trained model, apply the reduction to a source link::Classes/FluidDataSet:: and write to a destination. Can be the same
ARGUMENT:: sourceDataset ARGUMENT:: sourceDataSet
Source data, or the dataset name Source data, or the DataSet name
ARGUMENT:: destDataset ARGUMENT:: destDataSet
Destination data, or the dataset name Destination data, or the DataSet name
ARGUMENT:: action ARGUMENT:: action
Run when done Run when done
METHOD:: fitTransform METHOD:: fitTransform
link::Classes/FluidPCA#fit:: and link::Classes/FluidPCA#transform:: in a single pass link::Classes/FluidPCA#fit:: and link::Classes/FluidPCA#transform:: in a single pass
ARGUMENT:: sourceDataset ARGUMENT:: sourceDataSet
Source data, or the dataset name Source data, or the DataSet name
ARGUMENT:: destDataset ARGUMENT:: destDataSet
Destination data, or the dataset name Destination data, or the DataSet name
ARGUMENT:: action ARGUMENT:: action
Run when done Run when done
@ -105,9 +105,9 @@ FluidBufMFCC.process(s,~audio, features: ~mfcc_feature);
) )
//First standardize our dataset, so that the MFCC dimensions are on comensurate scales //First standardize our DataSet, so that the MFCC dimensions are on comensurate scales
//Then apply the PCA in-place on the standardized data //Then apply the PCA in-place on the standardized data
//Download the dataset contents into an array for plotting //Download the DataSet contents into an array for plotting
( (
~reducedarray = Array.new(100); ~reducedarray = Array.new(100);
~standardizer.fitTransform(~raw, ~standardized); ~standardizer.fitTransform(~raw, ~standardized);

@ -18,26 +18,26 @@ The server for this model
INSTANCEMETHODS:: INSTANCEMETHODS::
METHOD:: fit METHOD:: fit
Fit model to a dataset without applying scaling Fit model to a DataSet without applying scaling
ARGUMENT:: dataset ARGUMENT:: dataSet
The link::Classes/FluidDataSet:: to standardize The link::Classes/FluidDataSet:: to standardize
ARGUMENT:: action ARGUMENT:: action
A function to run when processing is complete A function to run when processing is complete
METHOD:: transform METHOD:: transform
Standardize a link::Classes/FluidDataSet::, using the learned statistics from a previous call to link::Classes/FluidStandardize#fit:: Standardize a link::Classes/FluidDataSet::, using the learned statistics from a previous call to link::Classes/FluidStandardize#fit::
ARGUMENT:: sourceDataset ARGUMENT:: sourceDataSet
The link::Classes/FluidDataSet:: to standardize The link::Classes/FluidDataSet:: to standardize
ARGUMENT:: destDataset ARGUMENT:: destDataSet
The link::Classes/FluidDataSet:: to populate with standardized data The link::Classes/FluidDataSet:: to populate with standardized data
ARGUMENT:: action ARGUMENT:: action
A function to run when processing is complete A function to run when processing is complete
METHOD:: fitTransform METHOD:: fitTransform
Standardize a link::Classes/FluidDataSet:: into another link::Classes/FluidDataSet:: Standardize a link::Classes/FluidDataSet:: into another link::Classes/FluidDataSet::
ARGUMENT:: sourceDataset ARGUMENT:: sourceDataSet
The link::Classes/FluidDataSet:: to standardize The link::Classes/FluidDataSet:: to standardize
ARGUMENT:: destDataset ARGUMENT:: destDataSet
The link::Classes/FluidDataSet:: to populate with standardized data The link::Classes/FluidDataSet:: to populate with standardized data
ARGUMENT:: action ARGUMENT:: action
A function to run when processing is complete A function to run when processing is complete

Loading…
Cancel
Save