Skip to main content

A Python Keras model API

Project description

aitk.keras

An implementation of the main Keras API with the layers in numpy.

UNDER DEVELOPMENT

Why?

  • useful to explain deep learning
  • can be used where tensorflow is not available (eg, JupterLite)

Features

  • supports Keras's Sequential and functional APIs
  • alternative dataset downloader for JupyterLite

Examples:

# Classic XOR
from aitk.keras.layers import Input, Dense
from aitk.keras.models import Sequential

inputs = [[0, 0], [0, 1], [1, 0], [1, 1]]
targets = [[0], [1], [1], [0]]

model = Sequential()
model.add(Input(2, name="input"))
model.add(Dense(8, activation="tanh", name="hidden"))
model.add(Dense(1, activation="sigmoid", name="output"))
model.compile(optimizer="adam", loss="mse")

outputs = model.predict(inputs)
model.fit(inputs, targets, epochs=epochs, verbose=0, shuffle=False)

See the notebook directory for additional examples.

See also the examples in the tests folder.

Development

  • implement shuffle
  • report metrics to logs/history
  • probably lots of edge cases ar broken
  • see "FIXME" items in code

To run the tests:

$ pytest -vvv tests

Please feel free to report issues and make Pull Requests!

References

Lowlevel numpy code based on numpy_ml.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

aitk.keras-0.3.5-py3-none-any.whl (172.3 kB view details)

Uploaded Python 3

File details

Details for the file aitk.keras-0.3.5-py3-none-any.whl.

File metadata

  • Download URL: aitk.keras-0.3.5-py3-none-any.whl
  • Upload date:
  • Size: 172.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.8.5

File hashes

Hashes for aitk.keras-0.3.5-py3-none-any.whl
Algorithm Hash digest
SHA256 d6b0a326a6fa8dfc8cc9b363bbf70ffa66620ae4dca9076db7fb92f137eb3e5c
MD5 d5e0176718b9c41b4c95fb2e5a4152ef
BLAKE2b-256 7ecf31bd422f6a534a082d6b617b6236c2565d7e7128a05a04d5dcccd5057630

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page