Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add a description for tiny example; bump to 0.3 version

  • Loading branch information...
commit b51033a1f7c1a8af0d5f64673026609c6e87e5f7 1 parent e467779
@nzhiltsov authored
View
26 README.md
@@ -8,7 +8,7 @@ Ext-RESCAL is a memory efficient implementation of [RESCAL](http://www.cip.ifi.l
Current Version
------------
-[0.2](https://github.com/nzhiltsov/Ext-RESCAL/archive/0.2.zip)
+[0.3](https://github.com/nzhiltsov/Ext-RESCAL/archive/0.3.zip)
Features
------------
@@ -37,15 +37,26 @@ Prerequisites
Usage Examples
----------------------
-1) Run the RESCAL algorithm to decompose a 3-D tensor with 2 latent components and zero regularization on the test data:
+1) Let's imagine we have the following semantic graph:
-<pre>python rescal.py --latent 2 --lmbda 0 --input tiny-example --outputentities entity.embeddings.csv --log rescal.log</pre>
+![semantic-graph](tiny-mixed-example/semantic-graph.png)
+
+Each tensor slice represents an adjacency matrix of the corresponding predicate (member-of, genre, cites). Run the RESCAL algorithm to decompose a 3-D tensor with 2 latent components and zero regularization on the test data:
+
+<pre>python rescal.py --latent 2 --lmbda 0 --input tiny-example --outputentities entity.embeddings.csv --outputfactors latent.factors.csv --log rescal.log</pre>
The test data set represents a tiny entity graph of 3 adjacency matrices (tensor slices) in the row-column representation. See the directory <i>tiny-example</i>. Ext-RESCAL will output the latent factors for the entities into the file <i>entity.embeddings.csv</i>.
-2) Run the extended version of RESCAL algorithm to decompose a 3-D tensor and 2-D matrix with 2 latent components and regularizer equal to 0.001 on the test data (entity graph and entity-term matrix):
+2) Then, we assume that there is an entity-term matrix:
+
+![entity-term-matrix](tiny-mixed-example/entity-term-matrix.png)
+
+Run the extended version of RESCAL algorithm to decompose a 3-D tensor and 2-D matrix with 2 latent components and regularizer equal to 0.001 on the test data (entity graph and entity-term matrix):
-<pre>python extrescal.py --latent 2 --lmbda 0.001 --input tiny-mixed-example --outputentities entity.embeddings.csv --outputterms term.embeddings.csv --log extrescal.log</pre>
+<pre>python extrescal.py --latent 2 --lmbda 0.001 --input tiny-mixed-example --outputentities entity.embeddings.csv --outputterms term.embeddings.csv --outputfactors latent.factors.csv --log extrescal.log</pre>
+
+If we plot the resulting embeddings, we would get the following picture, which reveals the similarity of entities and words in the latent space:
+![latent-space-visualization](tiny-mixed-example/TinyMixedExample.png)
Development and Contribution
----------------------
@@ -55,6 +66,11 @@ This is a fork of the original code base provided by [Maximilian Nickel](http://
Release Notes
------------
+0.3 (March 12, 2013):
+
+* Fix random sampling for the basic task
+* Add output of latent factors
+
0.2 (February 26, 2013):
* Add an opportunity to approximate the objective function via random sampling
View
BIN  tiny-mixed-example/TinyMixedExample.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  tiny-mixed-example/entity-term-matrix.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
8 tiny-mixed-example/semantic-graph.dot
@@ -0,0 +1,8 @@
+digraph semantic_graph {
+"dbr:Vibeke" -> "dbr:Tristania" [label="member-of"];
+"dbr:Morten" -> "dbr:Tristania" [label="member-of"];
+"dbr:Tristania" -> "dbr:Metal" [label="genre"];
+"author1" -> "author2" [label="cites"];
+"author1" -> "author1" [label="cites"];
+"author2" -> "author2" [label="cites"];
+}
View
BIN  tiny-mixed-example/semantic-graph.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Please sign in to comment.
Something went wrong with that request. Please try again.