Skip to main content

Updates

  • Changed Name from The-Shaper to Memai
  • Added the train feature

How to Use

1. Install

pip install memai

2. Import

import memai

3. Create a Dataset

Each dataset row contains [input, output, loss]. Inputs should be lists, even for a single value.

dataset = [
    [[1], 3, -1],
    [[2], 3, 0],
    [[3], 5, 0]
]

4. Create a Model

AI = memai.Model("MyModel", dataset, None)

The third argument is the modulo. Use None for no modulo.

5. Make a Prediction

result = AI.think([2])
print(result)

6. Train (Newly Added)

The train function allows the model to learn by letting it try to answer a question and then adding its try to te dataset. For example

AI.train([4])

then if you do:

print(AI.dataset)

you will see something like:

[[[1],3,-1],[[2],3,0],[[3],5,0],[[4],5,0]]
                                 |
         Newly Added sublist  -----

in the terminal

7. Get Correct Outputs

print(AI.get_correct_outputs())

This returns the reconstructed outputs using output - loss.

8. Change the Dataset

Use the following code to change the dataset of the model. Warning : This fully changes the model. The whole dataset before will be lost after this is done.

AI.change_dataset([
    [[4], 7, 0],
    [[5], 8, 1]
])

9.Display the Dataset

Bored of doing print(AI.dataset)to see the dataset all the time? There is a solution. Use display() to print your model's dataset in a neat table. Nothing else

import shaper

dataset = [
    [[1], 3, -1],
    [[2], 3, 0],
    [[3], 5, 0]
]

AI = shaper.Model("MyModel", dataset, None)
AI.display()

Example output:

==================================================
 THE SHAPER: MyModel
==================================================
INPUT               OUTPUT         LOSS
--------------------------------------------------
[1]                 3              -1
[2]                 3              0
[3]                 5              0
==================================================

Each row shows the input, stored output, and loss.

The model will use the updated dataset for future predictions.

Note:

This is actually the newer version of The-Shaper. The older vesrion has been archibed

Metadata

Release files for MemAI 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for MemAI 1.0.0
File Size Uploaded Provenance Actions
memai-1.0.0.tar.gz 3.9 kB Without provenance Details for memai-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for MemAI 1.0.0
File Interpreter ABI Platform Actions
memai-1.0.0-py3-none-any.whl Python 3 none any Details for memai-1.0.0-py3-none-any.whl

Total release size: 7.9 kB

Release files / memai-1.0.0.tar.gz

Download URL memai-1.0.0.tar.gz
Size 3.9 kB
Tags Source
SHA-256 checksum
How to use checksums
1bb5983580e150c8ec2231f4e85fda7ffb51574e4376d0691ae6812a01c7b1a9
BLAKE2b-256 checksum
How to use checksums
8dd3615b15201bb55f99d7ea208e1de2f0856235e98779fae3e22dff3b698ade
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.9

Release files / memai-1.0.0-py3-none-any.whl

Download URL memai-1.0.0-py3-none-any.whl
Size 4.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7ee9a07f52ea32015af3eb2de2c5bbeb794465620ad25c714fb7399f3dc20a2c
BLAKE2b-256 checksum
How to use checksums
a3418252a18a04e70672166a3e2ad4ba55930a183dd38bb18068fb8bfae9a113
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.9

Security for MemAI 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page