semvec/pypi-packages huggingface dataset:
neural-structured-learning 1.4.0
Neural Structured Learning is an open-source TensorFlow framework to train neural networks with structured signals

Neural Structured Learning (NSL) is a new learning paradigm to train neural
networks by leveraging structured signals in addition to feature inputs.
Structure can be explicit as represented by a graph or implicit as induced
by adversarial perturbation.

Structured signals are commonly used to represent relations or similarity
among samples that may be labeled or unlabeled. Leveraging these signals
during neural network training harnesses both labeled and unlabeled data,
which can improve model accuracy, particularly when the amount of labeled
data is relatively small. Additionally, models trained with samples that are
generated by adversarial perturbation have been shown to be robust against
malicious attacks, which are designed to mislead a model's prediction or
classification.

NSL generalizes to Neural Graph Learning as well as to Adversarial Learning.
The NSL framework in TensorFlow provides the following easy-to-use APIs and
tools for developers to train models with structured signals:

* Keras APIs to enable training with graphs (explicit structure) and
  adversarial perturbations (implicit structure).

* TF ops and functions to enable training with structure when using
  lower-level TensorFlow APIs.

* Tools to build graphs and construct graph inputs for training.

The NSL framework is designed to be flexible and can be used to train any
kind of neural network. For example, feed-forward, convolution, and
recurrent neural networks can all be trained using the NSL framework. In
addition to supervised and semi-supervised learning (a low amount of
supervision), NSL can in theory be generalized to unsupervised learning.
Incorporating structured signals is done only during training, so the
performance of the serving/inference workflow remains unchanged.
pserializeation 0.0.1
A de/serialization library for python
Requires Python: >=3.9

# PSerialization
Python library for serializing & deserializing python objects.

Out of the box support for "basic" object de/serialization, that is objects that hold all of their state in __ dict __ and have a trivial __ new __.

For more complicated types like datetime.datetime, users of this library can supply custom middleware to handle de/serializing those types.

Useful for sending python objects to a system that may only be expecting to handle primitive types, as well as reconstructing python objects from systems that lack type information. I personally use this for editing/loading configuration files stored as json, and for loading objects from nosql dbs like MongoDB.


## 'Basic' Object Example
```python
from pserialize.serializer import Serializer
from pserialize.deserializer import Deserializer

serializer = Serializer()
deserializer = Deserializer()

class Shoe():
	def __init__(self, size: int, condition: str, brand: str):
		self.size = size
		self.condition = condition
		self.brand = brand

if __name__ == "__main__":
	shoes = [Shoe(11, "Good", "Nike"), Shoe(12, "Bad", "Geox")]
	
	# Serialize a python object into primitives
	serialized = serializer.serialize(shoes)
	
	assert serialized == [
		{ "size": 11, "condition": "Good", "brand": "Nike" },
		{ "size": 12, "condition": "Bad", "brand": "Geox" }
	]
	
	# Build back the object representation just from primitives
	deserialized = deserializer.deserialize(serialized, Shoe)
	
	assert deserialized == shoes
```


## Middleware Example
```python
from datetime import datetime
from pserialize.serializer import Serializer
from pserialize.deserializer import Deserializer

def serialize_datetime(date: datetime):
	return repr(date)

def deserialize_date(value: object):
	assert type(value) is str

	arg_str = value.split("(")[1]
	arg_str = arg_str.replace(")", "")
	args = arg_str.strip(" ").split(",")
	args = [int(arg) for arg in args]

	return datetime(*args)

serializer = Serializer(middleware={datetime: serialize_datetime})
deserializer = Deserializer(middleware={datetime: deserialize_datetime})

if __name__ == "__main__":
	date = datetime(2022, 7, 25, 11, 3, 44, 21000)

	# Serialized using the custom function
	serialized = serializer.serialize(date)
	assert serialized == "datetime.datetime(2022, 7, 25, 11, 3, 44, 21000)"

	# Deserialized back into the correct type
	deserialized = deserializer.deserialize(serialized, datetime)
	assert deserialized == date

```