Next: Introduction, Previous: (dir), Up: (dir) [Contents][Index]
This is the fsvd Reference Manual, version 0.0.3, generated automatically by Declt version 2.4 "Will Decker" on Wed Jun 20 11:48:25 2018 GMT+0.
• Introduction: | What fsvd is all about | |
• Systems: | The systems documentation | |
• Files: | The files documentation | |
• Packages: | The packages documentation | |
• Definitions: | The symbols documentation | |
• Indexes: | Concepts, functions, variables and data types |
Funky Singular Value Decomposition This is a Common Lisp implementation of Simon Funk's quasi svd as described at http://sifter.org/~simon/journal/20061211.html by Gabor Melis. It's under the MIT licence. See COPYING.
Next: Files, Previous: Introduction, Up: Top [Contents][Index]
The main system appears first, followed by any subsystem dependency.
• The fsvd system: |
Gabor Melis
MIT
Simon Funk’s quasi SVD
This is a Common Lisp implementation of Simon
Funk’s quasi svd as described at http://sifter.org/~simon/journal/20061211.html
0.0.3
fsvd.asd (file)
Files are sorted by type and then listed depth-first from the systems components trees.
• Lisp files: |
• The fsvd.asd file: | ||
• The fsvd/package.lisp file: | ||
• The fsvd/fsvd.lisp file: |
Next: The fsvd/package<dot>lisp file, Previous: Lisp files, Up: Lisp files [Contents][Index]
fsvd.asd
fsvd (system)
Next: The fsvd/fsvd<dot>lisp file, Previous: The fsvd<dot>asd file, Up: Lisp files [Contents][Index]
Previous: The fsvd/package<dot>lisp file, Up: Lisp files [Contents][Index]
package.lisp (file)
fsvd (system)
fsvd.lisp
Next: Definitions, Previous: Files, Up: Top [Contents][Index]
Packages are listed by definition order.
• The fsvd.system package: | ||
• The fsvd package: |
Next: The fsvd package, Previous: Packages, Up: Packages [Contents][Index]
fsvd.asd
Previous: The fsvd<dot>system package, Up: Packages [Contents][Index]
This is a Common Lisp implementation of Simon
Funk’s quasi svd as described at
http://sifter.org/~simon/journal/20061211.html. There is nothing quasi
about it when there are no missing elements in the original matrix and
the normalization factor is zero, but that requires a small learning
rate. Loss of orthogonality between singular vectors results from
using too large learning rates.
package.lisp (file)
common-lisp
Definitions are sorted by export status, category, package, and then by lexicographic order.
• Exported definitions: | ||
• Internal definitions: |
Next: Internal definitions, Previous: Definitions, Up: Definitions [Contents][Index]
• Exported macros: | ||
• Exported functions: | ||
• Exported generic functions: | ||
• Exported structures: | ||
• Exported classes: | ||
• Exported types: |
Next: Exported functions, Previous: Exported definitions, Up: Exported definitions [Contents][Index]
A simple, inefficient implementation of the macro interface to iterate over MATRIX.
Next: Exported generic functions, Previous: Exported macros, Up: Exported definitions [Contents][Index]
Return the SVD loaded from FILENAME.
Return a function of (ROW COLUMN) parameters that approximates MATRIX by SVD. The BASE-VALUE for SVD-VALUE is produced by BASE-APPROXIMATOR for the given coordinates, while CLIP is simply passed on. The returned function automatically translates to dense coordinates to query the SVD.
Write the content of SVD to FILENAME in a reasonably compact form.
Approximate the single-float MATRIX with a quasi singular value
decomposition. Each SV of an SVD consists of a left and a right
vector. The sum of the outer products of the left and right vectors of
its consituent SVs is the approximation provided by an SVD. This SVD
is quasi because while the rank of the approximation is N, the
singular values are not explicit.
The sparse matrix interface must be supported on MATRIX.
BASE-APPROXIMATOR is a function of row and column. Its values are
effectively subtracted from those of MATRIX. Don’t forget to supply
the same BASE-APPROXIMATOR to MAKE-SVD-APPROXIMATOR and
SVD-VALUE.
CLIP is a symbol that is fbound to a function that takes a single
single-float and returns it clamped into some valid range or leaves it
alone.
To make training fast, a new trainer function is compiled for each SVD
call using CLIP and DO-MATRIX-MACRO-NAME for MATRIX.
LEARNING-RATE controls the how much weights are drawn towards to
optimum at each step. By default the LEARNING-RATE is scaled by 1/MAE*
where MAE* is the MAE mean avarage error. To avoid normalization and
to have finer grained control one can return learning rate from the
supervisor.
The Tikhonov NORMALIZATION-FACTOR penalizes large weights.
After each iteration on a SV and also before adding a new SV SUPERVISE-SVD is invoked on SUPERVISOR. The return value being NIL indicates that the supervisor wants to stop. See SUPERVISE-SVD for details.
Return the value of the matrix represented by SVD at ROW and COLUMN. Start the summation from BASE-VALUE and CLIP the current sum to some valid range if any after every pass.
Next: Exported structures, Previous: Exported functions, Up: Exported definitions [Contents][Index]
Number those columns that are not empty from 0. Return NIL for empty columns.
Number those rows that are not empty from 0. Return NIL for empty rows.
Return the name of the macro that provides a
hopefully efficient way to iterate over MATRIX. See DO-MATRIX for an
example.
Return the number of rows of MATRIX. If DENSEP return the number of non-empty rows.
Call FUNCTION for each non-empty cell of MATRIX.
FUNCTION is of four parameters: ROW, COLUMN, VALUE and DENSE-INDEX
where DENSE-INDEX is akin to a row major index except it doesn’t skip
over empty cells. DENSE-INDEX is always less than the SIZE-OF the
MATRIX.
Return the number known cells in MATRIX. This is an upper limit for the dense indices produced by MAP-MATRIX.
This is invoked from SVD on its SUPERVISOR
argument. If ITERATION is NIL then a new SV is about to be added and
upon rejecting that and returning NIL the decomposition is finished.
When ITERATION is not NIL, it is a non-negative integer that is the
index of the current iteration on the last SV of SVD. MATRIX,
BASE-APPROXIMATOR, CLIP are passed through verbatim from the SVD call.
APPROXIMATION is a single-float vector that parallels MATRIX with
dense indices (see MAP-MATRIX). APPROXIMATION is updated when about to
start on a new SV.
Its second return value is a list conforming to (&KEY LEARNING-RATE SV) that can be used to change the learning rate dynamically and to initialize or change the compact representation of the current SV.
Return the number of columns of MATRIX. If DENSEP return the number of non-empty columns.
Next: Exported classes, Previous: Exported generic functions, Up: Exported definitions [Contents][Index]
SV is a pair of vectors. They are not of unit lenght. The singular value is implicitly defined as the product of their euclidean norms.
fsvd.lisp (file)
structure-object (structure)
(simple-array single-float *)
sv-left (function)
(setf sv-left) (function)
(simple-array single-float *)
sv-right (function)
(setf sv-right) (function)
Next: Exported types, Previous: Exported structures, Up: Exported definitions [Contents][Index]
Construct an instance, keep it around and while the
SVD is in progress inspect/save SVD-IN-PROGRESS, or set MAX-N-SVS as
you see how the learning is going.
fsvd.lisp (file)
standard-object (class)
(fsvd:make-svd)
svd-in-progress (generic function)
(setf svd-in-progress) (generic function)
:max-n-iterations
max-n-iterations (generic function)
(setf max-n-iterations) (generic function)
:max-n-svs
max-n-svs (generic function)
(setf max-n-svs) (generic function)
:trace-stream
*trace-output*
trace-stream (generic function)
(setf trace-stream) (generic function)
Previous: Exported classes, Up: Exported definitions [Contents][Index]
SVD consists of n SVs - pairs of left and right vector - of the same sizes. The matrix SVD represents in this form is obtained by summing pairwise the outer products of these vectors.
Previous: Exported definitions, Up: Definitions [Contents][Index]
• Internal macros: | ||
• Internal functions: | ||
• Internal generic functions: | ||
• Internal types: |
Next: Internal functions, Previous: Internal definitions, Up: Internal definitions [Contents][Index]
Next: Internal generic functions, Previous: Internal macros, Up: Internal definitions [Contents][Index]
Take SV that uses sparse indices of MATRIX and turn it into one that uses dense indices.
Take SV that uses dense indices of MATRIX and turn it into one that uses normal indices.
Return the declarations and the rest of the body as separate lists.
Next: Internal types, Previous: Internal functions, Up: Internal definitions [Contents][Index]
Previous: Internal generic functions, Up: Internal definitions [Contents][Index]
Previous: Definitions, Up: Top [Contents][Index]
• Concept index: | ||
• Function index: | ||
• Variable index: | ||
• Data type index: |
Next: Function index, Previous: Indexes, Up: Indexes [Contents][Index]
Jump to: | F L |
---|
Jump to: | F L |
---|
Next: Variable index, Previous: Concept index, Up: Indexes [Contents][Index]
Jump to: | (
A C D E F G H L M R S T W |
---|
Jump to: | (
A C D E F G H L M R S T W |
---|
Next: Data type index, Previous: Function index, Up: Indexes [Contents][Index]
Jump to: | L M R S T |
---|
Jump to: | L M R S T |
---|
Previous: Variable index, Up: Indexes [Contents][Index]
Jump to: | 2
C F L P S T |
---|
Jump to: | 2
C F L P S T |
---|