Skip to main content

crf beam search

Project description

crf-beam

Beam search for Bonito CRF models.

Usage

>>> import torch
>>> from crf_beam import beam_search
>>>
>>> T, C, S = 1000, 320, 64
>>> scores = torch.rand(T, C)
>>> back_guides = torch.rand(T + 1, S)
>>> post = torch.rand(T, S)
>>>
>>> sequence, qstring, moves = beam_search(scores, back_guides, post)
>>> sequence
'ACACTCGCAGCGCGATACGACTGATCGAGATATACTCAGTGTACACAGT...'
>>> qstring
'(&''(****95444"@732"55",--/5555"5"@@E"E4""","-#**...'

Developer Quickstart

Python

$ python3 -m venv venv3
$ source venv3/bin/activate
(venv3) $ pip install -r requirements.txt
(venv3) $ make build
(venv3) $ make test

WASM

$ make wasm
$ node tests/test.js

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

crf_beam-0.1.8-cp311-cp311-manylinux2014_x86_64.whl (2.9 MB view hashes)

Uploaded CPython 3.11

crf_beam-0.1.8-cp310-cp310-manylinux2014_x86_64.whl (2.9 MB view hashes)

Uploaded CPython 3.10

crf_beam-0.1.8-cp39-cp39-manylinux2014_x86_64.whl (2.9 MB view hashes)

Uploaded CPython 3.9

crf_beam-0.1.8-cp38-cp38-manylinux2014_x86_64.whl (2.9 MB view hashes)

Uploaded CPython 3.8

Supported by

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