All Projects → rsonthal → TreeRep

rsonthal / TreeRep

Licence: GPL-3.0 license
Learning Tree structures and Tree metrics

Programming Languages

Jupyter Notebook
11667 projects
julia
2034 projects
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to TreeRep

Buckets Js
A complete, fully tested and documented data structure library written in pure JavaScript.
Stars: ✭ 1,128 (+6166.67%)
Mutual labels:  tree, tree-structure
Array To Tree
Convert a plain array of nodes (with pointers to parent nodes) to a nested data structure
Stars: ✭ 141 (+683.33%)
Mutual labels:  tree, tree-structure
Abp.generaltree
For Abp vNext
Stars: ✭ 106 (+488.89%)
Mutual labels:  tree, tree-structure
Bosket
Collection of tree view components for front-end frameworks. 🌳
Stars: ✭ 457 (+2438.89%)
Mutual labels:  tree, tree-structure
mongodb-tree-structure
Implementing Tree Structure in MongoDB
Stars: ✭ 14 (-22.22%)
Mutual labels:  tree, tree-structure
Angular2 Tree Diagram
Angular Hierarchical UI module
Stars: ✭ 50 (+177.78%)
Mutual labels:  tree, tree-structure
Containers
This library provides various containers. Each container has utility functions to manipulate the data it holds. This is an abstraction as to not have to manually manage and reallocate memory.
Stars: ✭ 125 (+594.44%)
Mutual labels:  tree, tree-structure
prune
A tree library for Java 8 with functional sensibilities.
Stars: ✭ 22 (+22.22%)
Mutual labels:  tree, tree-structure
ng-treetable
A treetable module for angular 5
Stars: ✭ 32 (+77.78%)
Mutual labels:  tree, tree-structure
Relation Classification Using Bidirectional Lstm Tree
TensorFlow Implementation of the paper "End-to-End Relation Extraction using LSTMs on Sequences and Tree Structures" and "Classifying Relations via Long Short Term Memory Networks along Shortest Dependency Paths" for classifying relations
Stars: ✭ 167 (+827.78%)
Mutual labels:  tree, tree-structure
Wmderland
🌳 X11 tiling window manager using space partitioning trees
Stars: ✭ 341 (+1794.44%)
Mutual labels:  tree, tree-structure
performant-array-to-tree
Converts an array of items with ids and parent ids to a nested tree in a performant O(n) way. Runs in browsers and Node.js.
Stars: ✭ 193 (+972.22%)
Mutual labels:  tree, tree-structure
tree-json-generator
Simple JavaScript Tree Generator library
Stars: ✭ 13 (-27.78%)
Mutual labels:  tree, tree-structure
Ki
Go language (golang) full strength tree structures (ki in Japanese)
Stars: ✭ 61 (+238.89%)
Mutual labels:  tree, tree-structure
react-treefold
A renderless tree component for your hierarchical React views
Stars: ✭ 37 (+105.56%)
Mutual labels:  tree, tree-structure
Bplustree
A minimal but extreme fast B+ tree indexing structure demo for billions of key-value storage
Stars: ✭ 1,598 (+8777.78%)
Mutual labels:  tree, tree-structure
treetime
TreeTime is a data organisation, management and analysis tool. A tree is a hierarchical structure that arranges information in units and sub-units. TreeTime uses linked trees (one data item can be part of different distinct trees) to store and organise any general purpose data.
Stars: ✭ 26 (+44.44%)
Mutual labels:  tree, tree-structure
stefano-tree
Framework agnostic Nested Set (MPTT) implementation for PHP
Stars: ✭ 24 (+33.33%)
Mutual labels:  tree, tree-structure
Graphview
Flutter GraphView is used to display data in graph structures. It can display Tree layout, Directed and Layered graph. Useful for Family Tree, Hierarchy View.
Stars: ✭ 152 (+744.44%)
Mutual labels:  tree, tree-structure
vue-virtualised
Blazing fast scrolling and updating for any amount of list and hierarchical data.
Stars: ✭ 18 (+0%)
Mutual labels:  tree, tree-structure

TreeRep

This is a github repository containing the code for the paper: https://arxiv.org/abs/2005.03847 (now accepted at Neurips 2020). The code is written in Julia 1.1, but should be compatible upto julia 1.5. Please cite the relavent data sources.

Please cite using:

  @inproceedings{NEURIPS2020_093f65e0,
   author = {Sonthalia, Rishi and Gilbert, Anna},
   booktitle = {Advances in Neural Information Processing Systems},
   editor = {H. Larochelle and M. Ranzato and R. Hadsell and M. F. Balcan and H. Lin},
   pages = {845--856},
   publisher = {Curran Associates, Inc.},
   title = {Tree! I am no Tree! I am a low dimensional Hyperbolic Embedding},
   url = {https://proceedings.neurips.cc/paper/2020/file/093f65e080a295f8076b1c5722a46aa2-Paper.pdf},
   volume = {33},
   year = {2020}
  }

Basic Example:

If D is the matrix with the distances. Then

G2, W2  = TreeRep.metric_to_structure(D,undef,undef)

G2, W2  = TreeRep.metric_to_structure_no_recursion(D,undef,undef)

will return the tree structure G2 and the Weights W2. Now if D is n by n, then W2 will be 2n by 2n (unless changed as described below). Running

B = W2[1:nv(G2),1:nv(G2)];
B = sparse(B);
B = (B .> 0) .* B;

D2 = utilities.parallel_dp_shortest_paths(G2, B,false)[1:n,1:n];

Will extract the new metric on the tree. There is also a python wrapper for the julia code.


There is also a native python version using pytorch and networkx in the python version folder. That folder also has an example for how to use that code.


TO REDUCE MEMORY USGAE: - On line 19 of TreeRep.jl change from 2n to some other fraction such as 1.2n or 1.5n or general fn for f > 1. This will siginificantly memory usage from 4n^2 to f^2n^2. However, if the learned tree doesnt fit in fn nodes (due to additional steiner nodes) this will cause a slow down of the method.

UNLESS you are optimizing for DISTORTION DO NOT use the optimization feature for TreeRep. This is very slow and may degrade other statistics such as MAP.

The notebook in the src folder has examples for how to run the various experiments.

Note that to use the functions in the Author helper folder you will need the code from PT and LM and PM and set up the dependencies correctly.

--

The way the code is currently written it will not work with more than 16 threads

Trouble Shooting:

  1. Memory Issues:
  • Make sure the memory usage is not expected -- https://julialinearalgebra.github.io/BLASBenchmarksCPU.jl/v0.3/memory-required/ Note, the code uses FLoat64 matrices.

  • Try the above suggested change of changing 2n to 1.2n, 1.5n, 1.8n

  • If slowing the code down is okay, you can try switching off multithreading and making the matrix on line 19 a sparse matrix, so spzeros(2n,2n).

  • If you get a StackOverFlow error. One possible fix is to increase stack size by ulimit -s unlimited (on Ubuntu this is the command). If that doesn't work try metric_to_structure_no_recursion.

  1. Run time issues
  1. Incorrect/bad tree.
  • Check if the distances and the tolerance used are conflicting. That is, the tolerance should be smaller than that the distances.
  1. Other

Please open a github issue.


full_taxonomy.csv is from https://www.who.int/standards/classifications/classification-of-diseases

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].