semvec/pypi-packages huggingface dataset:
python_tsp 0.5.0
Library to solve the Traveling Salesperson Problem in pure Python.
License: MIT
Requires Python: <4.0,>=3.9

=================
Python TSP Solver
=================

``python-tsp`` is a library written in pure Python for solving typical Traveling
Salesperson Problems (TSP). It can work with symmetric and asymmetric versions.


Installation
============
.. code:: bash

  pip install python-tsp
  poetry add python-tsp  # if using Poetry in the project


Examples
========

Given a distance matrix as a numpy array, it is easy to compute a Hamiltonian
path with least cost. For instance, to use a Dynamic Programming method:

.. code:: python

   import numpy as np
   from python_tsp.exact import solve_tsp_dynamic_programming

   distance_matrix = np.array([
       [0,  5, 4, 10],
       [5,  0, 8,  5],
       [4,  8, 0,  3],
       [10, 5, 3,  0]
   ])
   permutation, distance = solve_tsp_dynamic_programming(distance_matrix)

The solution will be ``[0, 1, 3, 2]``, with total distance 17. Notice it is
always a closed path, so after node 2 we go back to 0.

To solve the same problem with a metaheuristic method:

.. code:: python

   from python_tsp.heuristics import solve_tsp_simulated_annealing

   permutation, distance = solve_tsp_simulated_annealing(distance_matrix)

Keep in mind that, being a metaheuristic, the solution may vary from execution
to execution, and there is no guarantee of optimality. However, it may be a
way faster alternative in larger instances.

If you with for an open TSP version (it is not required to go back to the
origin), just set all elements of the first column of the distance matrix to
zero:

.. code:: python

   distance_matrix[:, 0] = 0
   permutation, distance = solve_tsp_dynamic_programming(distance_matrix)

and in this case we obtain ``[0, 2, 3, 1]``, with distance 12. Notice that in
this case the distance matrix is actually asymmetric, and the methods here are
applicable as well.

The previous examples assumed you already had a distance matrix. If that is not
the case, the ``distances`` module has prepared some functions to compute an
Euclidean distance matrix or a
`Great Circle Distance <https://en.wikipedia.org/wiki/Great-circle_distance>`_.

For example, if you have an array where each row has the latitude and longitude
of a point,

.. code:: python

   import numpy as np
   from python_tsp.distances import great_circle_distance_matrix

   sources = np.array([
       [ 40.73024833, -73.79440675],
       [ 41.47362495, -73.92783272],
       [ 41.26591   , -73.21026228],
       [ 41.3249908 , -73.507788  ]
   ])
   distance_matrix = great_circle_distance_matrix(sources)

See the `project's repository <https://github.com/fillipe-gsm/python-tsp>`_
for more examples and a list of available methods.
ctc-asr-inference 0.1.0
CTC-based speech-recognition
License: MIT
Requires Python: <4.0,>=3.10

![tests](https://github.com/SELMA-project/ctc-asr-inference/actions/workflows/tests.yml/badge.svg)
[![pypi](https://img.shields.io/pypi/v/ctc-asr-inference.svg)](https://pypi.python.org/project/ctc-asr-inference)
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)
[![bear-ified](https://raw.githubusercontent.com/beartype/beartype-assets/main/badge/bear-ified.svg)](https://beartype.readthedocs.io)
[![Ruff-ified](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/dertilo/python-linters/blob/master/python_linters/ruff.toml)

# ctc-asr-inference
- ctc-logits-inferencer:
  - [huggingface+wav2vec2-based](ctc_asr_inference/ctc_logits_inferencer/hfwav2vec2_logits_inferencer.py)
  - [nvidia/nemo-based](ctc_asr_inference/ctc_logits_inferencer/nemo_asr_logits_inferencer.py)
- ctc-decoder:
  - [hf-greedy](ctc_asr_inference/ctc_decoding/huggingface_ctc_decoding.py)
  - [pyctc-based](ctc_asr_inference/ctc_decoding/pyctc_decoder.py)
- chunked-streaming-inference:
  - [ASR-Chunking-Inference-Gluing-Pipeline](ctc_asr_inference/chunked_inference/asr_chunk_infer_glue_pipeline.py)