Description Extends Warning Fields Methods Author(s) References See Also Examples
Provides a reference class that implements the self-organising-deltoids
(SOD) multi-dimensional-scaling algorithm (MDS) using openCL to
provide parallel execution on a general purpose GPU.
New objects are made by calling the initializer using either
DimSqueezer_CL$new(m)
or new("DimSqueezer_CL", m)
.
The initializer returns an object from which the methods and fields are accessed
using the $
operator. See the examples section for usage.
All reference classes extend and inherit methods from "envRefClass"
.
This class will only be available on computers where openCL
functionality is available.
DANGER: On Mac OSX, it seems possible to crash the
display driver (i.e. the computer is unusable, though not in a
completely hung state) if specifying a work group size (wksize
argument) that is larger than the
PREFERRED_WORK_GROUP_SIZE_MULTIPLE
. (This value is printed when
the class is initialized.)
Binary distributions of this package are unlikely to provide access this
class, though that will depend on the compilation environment.
I have only tested this on
a small number of computers, and am not sure how it will behave on
other systems. Precompiled binaries for Windows will by default not
have access to the openCL functionality.
This is a reference class that does not follow normal R semantic
rules. Copying objects does not make new copies, but additional
references. See ?setRefClass
for more details.
This class keeps an external pointer to a C++ object. This object
will be destroyed at the end of a session. If you wish to use it
after reloading a session you will need to recreate the
object. This can be done using the data.matrix field of the
object (for a DimSqueezer_CL object called ds)
ds <- DimSqueezer_CL$new( ds$data.matrix )
pointer
:Object of class externalptr
that refers to the C++ DimSqueezer_CL object (read only).
data.matrix
:Object of class matrix
a numeric matrix used to create the DimSqueezer.
squeeze(target_dim, iter_no, wksize)
:Squeezes points into
target_dim
dimensions in iter_no
iterations using
an openCL work group size of wksize
(see Warning).
Returns a
named list of class sod_sq3
containing the new coordinates in $pos
, the
stress evolution in $stress
, the mapping dimensionality in
mapDims
and the stress (sum error) at each node in node_stress
.
initialize(m)
:Initializes the object. m should be a numeric matrix (use by calling new as in examples).
Martin Jakt
DimSqueezer
serialDimFactors
parallelDimFactors
parallelExpDimFactors
sod_sq3
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | ## Not run:
showClass("DimSqueezer_CL")
## Make an openCL accelerated squeezer object
## note this is only available where both the physical
## hardware and the appropriate development environment
## is available.
data(f186)
## use columns 7:12 as these have comparable data
ds <- DimSqueezer_CL$new( as.matrix(f186[,7:12]) )
## squeeze, 1000 iterations using a work group size of 64
## giving a 2 dimensional representation.
sq <- ds$squeeze(2, 200, 64)
## functions to plot the relationships
plotPoints(sq)
## use columns of f186 to make a more interesting
## plot
plotPoints(sq, col=hsvScale(f186[r,"Etv2"]), pch=19)
plotPoints(sq, col=hsvScale(f186[r,"p_Etv2"]), pch=19)
## and a funky plot
plotConcentric(sq, f186[r,7:12], cex.max=5, pch=19, leg.pos="topleft")
## and to plot the stress mapping.
plotStress(sq1)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.