semvec/pypi-packages huggingface dataset:
NNFunction 0.0.2
A simple package for modelling multidimensional non-linear functions using artificial neural networks

# NNFunction
A simple package for modelling multidimensional non-linear functions using artificial neural networks.

## Installation

Install from `pip3`:

```bash
pip3 install --user NNFunction
```

Or by cloning this repository:

```bash
#clone the repo
git clone https://github.com/mattkjames7/NNFunction
cd NNFunction

#Either create a wheel and use pip: (X.X.X should be replaced with the current version)
python3 setup.py bdist_wheel
pip3 install --user dists/NNFunction-X.X.X-py3-none-any.whl

#Or by using setup.py directly
python3 setup.py install --user
```



## Usage

Start by training training a network:

```python
import NNFunction as nnf

#create the network, defining the activation functions and the number of nodes in each layer
net = nnf.NNFunction(s,AF='softplus',Output='linear')

#note that s should be a list, where each element denotes the number of nodes in each layer

#input training data
net.AddData(X,y)
#Input matrix X should be of the shape (m,n) - where m is the number of samples and n is the number of input features
#Output hypothesis matrix y should have the shape (m,k) - where k is the number of output nodes

#optionally add validation and test data
net.AddValidationData(Xv,yv)
#Note that validation data is ignored if kfolds > 1 during training
net.AddTestData(Xt,yt)

#Train the network 
net.Train(nEpoch,kfolds=k)
#nEpoch is the number of training epochs
#kfolds is the number of kfolds to do - if kfolds > 1 then the training data are split 
#into kfold sets, each of which has a turn at being the validation set. This results in
#kfold networks being trained in total (net.model)
#see docstring net.Train? to see more options

```

After training, the cost function may be plotted:

```python
net.PlotCost(k=k)
```

We can use the network on other data:

```python
#X in this case is a new matrix
y = net.Predict(X)
```

The networks can be saved and reloaded:

```python
#save
net.Save(fname='networkname.bin')

#reload
net = nnf.LoadANN(fname='networkname.bin')
```

The animation below demonstrates the training of a neural network used to reproduce four different functions simultaneously. It was produced using `NNFunction.TrainNN4`.

![](nn.gif)
szyfrow 0.0.7
Tools for using and breaking simple ciphers
Requires Python: >=3.7

# Szyfow ciphers

Simple (mainly manual) ciphers, and routines for enciphering, deciphering, 
and breaking messages created with them.

The ciphers implemented here are mostly ones that predate mechanical cipher
systems. The most complex cipher is the Enigma of World War II.

Each cipher is presented with functions to encipher, decipher, and 
automatically break messages with that cipher.

Most of the time, messages are broken by brute-force trying each possible key
and scoring the resulting deciphered message using a bag-of-words probability
measure (or a bag-of-bigrams, or a bag-of-trigrams).

You can find more information on the ciphers and how they are implemented in
the [codes and ciphers area of my blog](https://work.njae.me.uk/tag/codes-and-ciphers/).

Ciphers work on messages encoded with the 26 letters of the Latin alphabet,
without accents (the letters contained in the `string.ascii_letters` constant).
Most of the ciphers convert letters to lowercase, strip accents from letters,
and drop all other characters (such as spaces and punctuation).

`szyfrow.support.text_prettify` contains functions to make the output easier
to read, such as automatically recovering word boundaries.

The name comes from the Polish cipher bureau, the Biuro Szyfrów, who were 
breaking Enigma ciphers by hand before World War II.