Skip to main content

pytorch tree lstm package

Project description

Tree LSTM

This repository contains a Pytorch Implementation of "Improved Semantic Representations From Tree-Structured Long Short-Term Memory Networks " (https://arxiv.org/abs/1503.00075).

This contains two type of tree-lstm (Child sum, N-ary). This was tested by Python 3.6, Pytorch 1.3.0., and this internally uses dgl 0.4.0

This repository referenced https://github.com/dmlc/dgl/blob/master/examples/pytorch/tree_lstm/tree_lstm.py

Installation

pip install tree-lstm

after installed, you can use this via

import TreeLSTM, Tree, BatchedTree

Usage

  1. make Tree object (initialize with arbitrary tensor)
  2. make BatchedTree object using list of Tree object
  3. make TreeLSTM object (inherited from torch.nn.Module)
  4. pass BatchedTree object into TreeLSTM object

For more detailed usage, please see test.py

Thanks for reporting issues / contributions / starts / watches!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tree_lstm-0.0.8.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tree_lstm-0.0.8-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file tree_lstm-0.0.8.tar.gz.

File metadata

  • Download URL: tree_lstm-0.0.8.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.1.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.6

File hashes

Hashes for tree_lstm-0.0.8.tar.gz
Algorithm Hash digest
SHA256 e4fd06882bb9050f9f5dd544657afb94d0c3cdefc8c6a08d2ae76c773db523f4
MD5 4a6ba79858a88bf4f4a22b855a755853
BLAKE2b-256 951728233190ef37d705d682bc5e29d484a820329a871016ad5e1994d08e5d84

See more details on using hashes here.

File details

Details for the file tree_lstm-0.0.8-py3-none-any.whl.

File metadata

  • Download URL: tree_lstm-0.0.8-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.1.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.6

File hashes

Hashes for tree_lstm-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 f41d7644af4bd665e80b00f02cd507fc3b31605ee168d6ab354930cb8f6f558f
MD5 2840f802179535d37c8f960a89614371
BLAKE2b-256 3bfdeabb0e63d10e6662bc9e9ead9b1bb2906e54ec5d4d8248ca365a8aa9ad5d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page