Normalize / Standardize review

nix
Gerard 6 years ago
parent 48ee95f77c
commit c129ad78b5

@ -9,19 +9,25 @@ FluidNormalize : FluidManipulationClient {
id = uid; id = uid;
} }
fit{|dataset, action| fit{|dataset, action|
this.prSendMsg(\fit,[dataset.asSymbol],action); this.prSendMsg(\fit,[dataset.asSymbol], action);
} }
fitTransform{|dataset, action| transform{|sourceDataset, destDataset, action|
this.prSendMsg(\fit,[dataset.asSymbol],action); this.prSendMsg(\transform,
} [sourceDataset.asSymbol, destDataset.asSymbol], action
);
}
transform{|sourceDataset, destDataset, action| fitTransform{|sourceDataset, destDataset, action|
this.prSendMsg(\transform,[sourceDataset.asSymbol, destDataset.asSymbol],action); this.prSendMsg(\fitTransform,
} [sourceDataset.asSymbol, destDataset.asSymbol], action
);
}
transformPoint{|sourceBuffer, destBuffer, action| transformPoint{|sourceBuffer, destBuffer, action|
this.prSendMsg(\transformPoint,[sourceBuffer.asUGenInput, destBuffer.asUGenInput],action); this.prSendMsg(\transformPoint,
} [sourceBuffer.asUGenInput, destBuffer.asUGenInput], action
);
}
} }

@ -9,19 +9,25 @@ FluidStandardize : FluidManipulationClient {
id = uid; id = uid;
} }
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{|dataset, action| fitTransform{|sourceDataset, destDataset, action|
this.prSendMsg(\fitTransform,[dataset.asSymbol],action); this.prSendMsg(\fitTransform,
} [sourceDataset.asSymbol, destDataset.asSymbol], action
);
}
transformPoint{|sourceBuffer, destBuffer, action| transformPoint{|sourceBuffer, destBuffer, action|
this.prSendMsg(\transformPoint,[sourceBuffer.asUGenInput, destBuffer.asUGenInput],action); this.prSendMsg(\transformPoint,
} [sourceBuffer.asUGenInput, destBuffer.asUGenInput], action
);
}
} }

@ -4,7 +4,7 @@ categories:: FluidManipulation
related:: Classes/FluidStandardize, Classes/FluidDataSet related:: Classes/FluidStandardize, Classes/FluidDataSet
DESCRIPTION:: DESCRIPTION::
Normalize the entries of a link::Classes/FluidDataSet::, or normalize a data point according to the learned bounrds of a data set. On the server. Normalize the entries of a link::Classes/FluidDataSet::, or normalize a data point according to the learned bounds of a data set. On the server.
See http://www.faqs.org/faqs/ai-faq/neural-nets/part2/section-16.html See http://www.faqs.org/faqs/ai-faq/neural-nets/part2/section-16.html
@ -25,21 +25,24 @@ Maximum output value, default 1
INSTANCEMETHODS:: INSTANCEMETHODS::
METHOD:: fit METHOD:: fit
Normalize a link::Classes/FluidDataSet:: strong::in-place:: 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:: fitTransform METHOD:: transform
Normalize a link::Classes/FluidDataSet:: strong::in-place:: Normalize a link::Classes/FluidDataSet:: into another link::Classes/FluidDataSet::, using the learned extrema from a previous call to link::Classes/FluidNormalize#fit::
ARGUMENT:: dataset ARGUMENT:: sourceDataset
The link::Classes/FluidDataSet:: to normalize The link::Classes/FluidDataSet:: to normalize
ARGUMENT:: destDataset
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
METHOD:: transform
Normalize a link::Classes/FluidDataSet:: non-destructively into another link::Classes/FluidDataSet:: METHOD:: fitTransform
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
@ -47,8 +50,9 @@ 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
METHOD:: transformPoint METHOD:: transformPoint
Normalize a new data point, using the learned extrema from a previous link::Classes/FluidNormalize#fit::ting Normalize a new data point, using the learned extrema from a previous call to link::Classes/FluidNormalize#fit::
ARGUMENT:: sourceBuffer ARGUMENT:: sourceBuffer
A link::Classes/Buffer:: with the new data point A link::Classes/Buffer:: with the new data point
ARGUMENT:: destBuffer ARGUMENT:: destBuffer
@ -56,26 +60,6 @@ A link::Classes/Buffer:: to contain the normalized value
ARGUMENT:: action ARGUMENT:: action
A function to run when processing is complete A function to run when processing is complete
METHOD:: cols
Retreive the dimensionality of the data set we have fitted on
ARGUMENT:: action
A function to run when the server responds, taking the dimensions as its argument
METHOD:: read
Load internal state (dimensionality, mins, maxes) from a JSON file
ARGUMENT:: filename
Absolute path to the JSON file
ARGUMENT:: action
A function to run when file is loaded
METHOD:: write
Store the internal state of object on disk as a JSON file. Will not overwrite existing files
ARGUMENT:: filename
Absolute path of file to write
ARGUMENT:: action
A function to run when file is written
EXAMPLES:: EXAMPLES::
code:: code::
s.boot; s.boot;

@ -25,7 +25,7 @@ ARGUMENT:: action
A function to run when processing is complete A function to run when processing is complete
METHOD:: transform METHOD:: transform
Standrdize a link::Classes/FluidDataSet:: non-destructively into another link::Classes/FluidDataSet:: 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
@ -34,14 +34,14 @@ ARGUMENT:: action
A function to run when processing is complete A function to run when processing is complete
METHOD:: fitTransform METHOD:: fitTransform
Standrdize a link::Classes/FluidDataSet:: fit and scale a link::Classes/FluidDataSet:: in-place 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:: action ARGUMENT:: action
A function to run when processing is complete A function to run when processing is complete
METHOD:: transformPoint METHOD:: transformPoint
Standardize a new data point, using the learned statistics from a previous link::Classes/FluidStandardize#fit::ting Standardize a new data point, using the learned statistics from a previous call to link::Classes/FluidStandardize#fit::
ARGUMENT:: sourceBuffer ARGUMENT:: sourceBuffer
A link::Classes/Buffer:: with the new data point A link::Classes/Buffer:: with the new data point
ARGUMENT:: destBuffer ARGUMENT:: destBuffer
@ -49,24 +49,6 @@ A link::Classes/Buffer:: to contain the standardize value
ARGUMENT:: action ARGUMENT:: action
A function to run when processing is complete A function to run when processing is complete
METHOD:: cols
Retreive the dimensionality of the data set we have fitted on
ARGUMENT:: action
A function to run when the server responds, taking the dimensions as its argument. Will print to post window by default
METHOD:: read
Load internal state (dimensionality, means, deviations) from a JSON file
ARGUMENT:: filename
Absolute path to the JSON file
ARGUMENT:: action
A function to run when file is loaded
METHOD:: write
Store the internal state of object on disk as a JSON file.
ARGUMENT:: filename
Absolute path of file to write
ARGUMENT:: action
A function to run when file is written
EXAMPLES:: EXAMPLES::
code:: code::
@ -138,4 +120,4 @@ fork{
~rawarray.flatten(1).unlace.plot("Unstandardized",Rect(0,0,400,400),minval:0,maxval:[5000,1]).plotMode=\bars; ~rawarray.flatten(1).unlace.plot("Unstandardized",Rect(0,0,400,400),minval:0,maxval:[5000,1]).plotMode=\bars;
~plot2 = ~stdarray.flatten(1).unlace.plot("Standardized",Rect(410,0,400,400)).plotMode=\bars; ~plot2 = ~stdarray.flatten(1).unlace.plot("Standardized",Rect(410,0,400,400)).plotMode=\bars;
) )
:: ::

Loading…
Cancel
Save