semvec/pypi-packages huggingface dataset:
KASS 1.0.0
Keras Advanced Serial Sampler.
Requires Python: >=2.7

This library offers a randomization tool for advanced
serial sampling of native and custom keras object
attributes. Randomization is performed by a modulated
function, which allows for the dynamic randomization
of interdependent attributes of a serialized keras
object.

## Note:
Sample functions found in the sample directory
are based on the 2.3.1 keras version and may not
be compatible with previous versions. However the
core functionality is fully functional across
multiple keras versions. For sampler support of
custom keras objects or modification see below.

**Custom Layer:**
```
from KASS import Process, run
from KASS.layers import custom
from collections import deque

@custom('{custom_layer_class_name}') #override=True, to replace existing sampler function
def sample(serial, attributes=[], ranges=default_ranges):
    input_, input_shape, output_shape, queue = serial['input'], serial['input_shape'], serial['output_shape'], deque([])

    @Process(serial, queue)
    def attr1():
        pass
    
    @Process(serial, queue)
    def attr2():
        pass
    
    ...
    
    run(queue, attributes, locals())
```

**Custom Constraint:**
```
from KASS import Process, run
from KASS.constraints import custom
from collections import deque

@custom('{custom_constraint_class_name}') #override=True, to replace existing sampler function
def sample(serial, input_shape, attributes=[], ranges=default_ranges):
    queue = deque([])
    
    @Process(serial, queue)
    def attr1():
        pass
    
    @Process(serial, queue)
    def attr2():
        pass
    
    ...
    
    run(queue, attributes, locals())
```

**Custom Initializer:**
```
from KASS import Process, run
from KASS.initializers import custom
from collections import deque

@custom('{custom_initializer_class_name}') #override=True, to replace existing sampler function
def sample(serial, attributes=[], ranges=default_ranges):
    queue = deque([])
    
    @Process(serial, queue)
    def attr1():
        pass
    
    @Process(serial, queue)
    def attr2():
        pass
    
    ...
    
    run(queue, attributes, locals())
```

**Custom Regularizer:**
```
from KASS import Process, run
from KASS.regularizers import custom
from collections import deque

@custom('{custom_regularizer_class_name}') #override=True, to replace existing sampler function
def sample(serial, attributes=[], ranges=default_ranges):
    queue = deque([])
    
    @Process(serial, queue)
    def attr1():
        pass
    
    @Process(serial, queue)
    def attr2():
        pass
    
    ...
    
    run(queue, attributes, locals())
```

## Repository:
https://github.com/iflor413/KASS

## Compatibility:
**Python:** >= 2.7
**Keras:** 2.0.8, 2.1.2, 2.1.3, 2.1.4, 2.1.5, 2.1.6, 2.2.0, 2.2.2, 2.2.4, 2.3.1 (see Note section)
KASD 1.0.0
Keras Advanced Serialization & Deserialization (KASD) Tools.
Requires Python: >=2.7

This library offers an Advanced Serialization and Deserialization
system with custom keras object support. Built layers (tensors) can
be serialized into a dictionary that includes information used for
deserialized. A collection of tensors can also be serialized into a
series which can be deserialized into a list of inter-connected tensors.
Custom keras objects can also be supported natively with keras and
with the advanced serialization and deserialization functionality.

## Note:
A decorator can be used to register custom keras objects. This
decorator links custom objects to the _GLOBAL_CUSTOM_OBJECTS
from keras.utils.generic_utils._GLOBAL_CUSTOM_OBJECTS for
native support. See below on how to add custom keras objects.

**Custom Layer:**
```
from KASD.layers import layers, custom

@layers.custom
class layer(...):
    pass
 
#or

@custom
class layer(...):
    pass
    
#or

@layers
class layer(...):
    pass
```

**Custom Constraint:**
```
from KASD.constraints import constraints, custom

@constraints.custom
class constraint(...):
    pass
 
#or

@custom
class constraint(...):
    pass
    
#or

@constraints
class constraint(...):
    pass
```

**Custom Initializer:**
```
from KASD.initializers import initializers, custom

@initializers.custom
class initializer(...):
    pass
 
#or

@custom
class initializer(...):
    pass
    
#or

@initializers
class initializer(...):
    pass
```

**Custom Regularizer:**
```
from KASD.regularizers import regularizers, custom

@regularizers.custom
class regularizer(...):
    pass
 
#or

@custom
class regularizer(...):
    pass
    
#or

@regularizers
class regularizer(...):
    pass
```

**Custom Activation:**
```
from KASD.activations import activations, custom

@activations.custom
def activation(...):
    pass
 
#or

@custom
def activation(...):
    pass
    
#or

@activations
def activation(...):
    pass
```

## Repository:
https://github.com/iflor413/KASD

## Compatibility:
**Python:** >= 2.7
**Keras:** 2.0.8, 2.1.2, 2.1.3, 2.1.4, 2.1.5, 2.1.6, 2.2.0, 2.2.2, 2.2.4, 2.3.1
latexclippings 0.1.3
Batch render LaTeX files to cropped SVG images
Requires Python: >=3.6

# LaTeXclippings

_Batch render LaTeX files to cropped SVG images._

![Rendered LaTeX: I love LaTeX!](demo/latex.svg)

![Rendered LaTeX: sum from 1 to n](demo/summation.svg)

## Features

LaTeXclippings takes multiple LaTeX files, and an optional preamble, as input. Using your computer's LaTeX installation, it renders each input file as an SVG image or embeddable HTML `<img>` tag. All relevant LaTeX features are supported, including regular text, inline and display math, and tables.

Each rendered image is cropped, allowing it to be easily embedded in other content. When generating HTML `<img>` tags, additional CSS style rules are added, which adjust the SVG's scale and baseline to match the surrounding text. No more misaligned equations!

LaTeXclippings also parses the `pdflatex` log, matching up each input file with the corresponding log output. If any error messages are found, they are converted into informative Python exceptions, which identify the file and line responsible for an error.

## Installation

Install from [PyPI](https://pypi.org/project/latexclippings/):

```console
pip install latexclippings
```

Alternatively, simply download [latexclippings.py](latexclippings.py).

### Dependencies

LaTeXclippings requires Python 3.6+, and also uses:

* `pdflatex` to generate PDFs from LaTeX source
* `inkscape` for PDF cropping and SVG conversion

## Usage

### Command Line

The `latexclippings` command reads LaTeX files (or standard input) and outputs SVG or embeddable HTML. (If you did not install LaTeXclippings from PyPI, you can use `./latexclippings.py` or `python latexclippings.py` instead.)

Using standard input and output:

```console
$ # Kinetic energy formula (in classical mechanics).
$ echo '$ E_k = \frac{1}{2}mv^2 $' | latexclippings > kinetic-energy.svg
```

![Rendered LaTeX: kinetic energy](demo/kinetic-energy.svg)

Rendering multiple LaTeX files to HTML, using a custom preamble:

```console
$ latexclippings --format html --preamble my-preamble.tex \
>         apple.tex banana.tex grape.tex
$ ls
apple.html  banana.html  grape.html  my-preamble.tex
apple.tex   banana.tex   grape.tex
```

The contents of `apple.html` (note the inline CSS styles for scaling and alignment):

```html
<img style="display: inline-block; width: 21.38669ex;
height: 2.08727ex; vertical-align: -0.45000ex;"
alt="I enjoy eating apples." title="I enjoy eating apples."
src="data:image/svg+xml;base64, PHN2ZwogICB4bWxuczp...">
```

![Rendered LaTeX: apples](demo/apple.svg)

### Python API

For more sophisticated usage (e.g. integration into a static website generator), you can use the Python API.

```python
from latexclippings import LatexFile

lf = LatexFile([r"This is some \LaTeX code.", r"Math: $ \sin(x) $"])
lf.render()

c = lf.clippings[0]
print(f"The first clipping is {c.width} by {c.height} ex, "
        + f"with {c.depth} ex below the baseline.")

with open("math.svg", "w") as f:
    f.write(lf.clippings[1].svg)
```

## License

LaTeXclippings is licensed under the [MIT License](LICENSE.md).