semvec/pypi-packages huggingface dataset:
tensorsocket 0.0.3
Data loading orchestrator for separating loading and training into different processes, sharing data one-to-many and connected via TCP.
Requires Python: >=3.10.0

# tensorsocket
Share PyTorch tensors over ZMQ sockets

## Installation

Install as module. Should be installed in a project such as [RAD/data-sharing](https://github.com/Resource-Aware-Data-systems-RAD/data-sharing)

**From source**

From the root of the tensorsocket directory, install it with pip:

```shell
$ pip install .
```

**From PyPi**

```shell
$ pip install tensorsocket
```

## Usage

tensorsocket works by exposing batches of data, represented as PyTorch tensors, on sockets that training processes can access. This allows for minimizing redundancy of training data during collocated tasks such as hyper-parameter tuning. Training with tensorsocket builds on the concept of a producer-consumer relationship, where the following example code shows how the producer wraps around an arbitrary data loader object. As with nested epoch-batch loops, one can iterate over the producer in the same manner as iterating over a data loader.

The use of tensorsocket relies on a `TensorProducer` and `TensorConsumer`. The `TensorProducer` can be used as is, however the `TensorConsumer` needs to be embedded in a class that exposes the same functionality as a PyTorch data loader, as shown in the `SharedLoader` example class, below:

```python
# shared_data_loader.py

from tensorsocket import TensorConsumer

class SharedLoader(object):

    def __init__(self, port="5556", ack_port="5557"):
        self.consumer = TensorConsumer(port, ack_port)
        self.counter = 0

    def __iter__(self):
        self.counter = 0
        return self

    def __next__(self):
        if self.counter < self.__len__():
            self.counter += 1
            return next(self.consumer)
        else:
            raise StopIteration

    def __len__(self):
        return len(self.consumer)

```

Using the `TensorProducer` requires next to no additional implementation, apart from the original data loader. 

```python
# producer.py

data_loader = DataLoader(dataset)

producer = TensorProducer(data_loader, port="5556", ack_port="5557")

for _ in range(epochs):
        for _ in producer:
            pass
producer.join()
```

Given the `SharedLoader` with the `TensorConsumer` class, it is straightforward to modify a training script to fetch batches of data from the shared loader, rather than using the process-specific data loader, which is created for each collocated training job.

```python
# consumer.py (or train.py)
from ... import SharedLoader

...

if not use_shared_loader:
    data_loader = create_loader(...)
else:
    data_loader = SharedLoader()

...

for batch_idx, (input, target) in enumerate(data_loader):
    output = model(input)
    ...

```

## Features
focus-package 3.1.0
FOCUS package including DLS-76 and KRIBER
Keywords: focus,zeolites,structure-determination,dls76,kriber,electron-diffraction-data,powder-diffraction-data

![PyPI - Python Version](https://img.shields.io/pypi/pyversions/focus-package)
![PyPI](https://img.shields.io/pypi/v/focus-package.svg?style=flat)


FOCUS
=====

FOCUS is a program for structure determination of zeolites. It combines automatic Fourier recycling with a specialized topology search specific to zeolites or zeolite-like materials. This makes it ideal for structure determination from powder or electron diffraction data, because the framework search can make up for the loss of information from peak overlap or dynamical effects. This package also includes KRIBER, DLS76, and several python helper scripts that work together to analyze the results, optimize the framework geometry, and produce CIF files.

Installation
============

If you are a python user, you can install via pip:

    pip install focus-package

Alternatively, you can download one of the packages from the [releases](https://github.com/stefsmeets/focus_package/releases/latest) page.


Programs included
=================

 - focus
 - kriber
 - sginfo
 - dls76       
 - kriber      
 - fo2cif      
 - fo2hist     
 - fo2strudat  
 - strudat2cif 
 - dlsall      
 - cdlsall     
 - multifocal  

Please see the [manual](../master/manuals) for instructions.

Installation from source
========================

Extra dependencies for installation from source:

Build scripts:
 - [./focus/focus_build_script.sh](../master/focus/focus_build_script.sh)
 - [./src/kriber/makefile](../master/src/kriber/makefile)
 - [./src/dls76/makefile](../master/src/dls76/makefile)
 
References
==========

- S. Smeets, L. B. McCusker, C. Baerlocher, E. Mugnaioli, and U. Kolb. [Using FOCUS to solve zeolite structures from three-dimensional electron diffraction data](http://dx.doi.org/10.1107/S0021889813014817). J. Appl. Crystallogr., 46:1017–1023, 2013

- R. W. Grosse-Kunstleve, L. B. McCusker, C. Baerlocher. [Zeolite structure determination from powder diffraction data: applications of the FOCUS method](http://dx.doi.org/10.1107/S0021889899003453). J. Appl. Crystallogr., 32:536-542, 1999

- R. W. Grosse-Kunstleve, L. B. McCusker, C. Baerlocher. [Powder diffraction data and crystal chemical information combined in an automated structure determination procedure for zeolites](http://dx.doi.org/10.1107/S0021889897005013). J. Appl. Crystallogr., 30:985-995, 1997
tcgame 1.0.1
A library with access to multiple game environments.
Requires Python: >=3.6, <3.10

一款可以获得多个游戏环境的库。

#### **游戏环境介绍：**

- "path_finding"	: 寻找终点（一维巡径）
- "path_finding_2d"	: 迷宫（二维巡径）
- "flappybird"		: 飞扬的小鸟