Skip to main content

keras-style deep network package for classification and prediction

Project description

deepfree

Keras-style deep network package for classification and prediction.

install

pip install --upgrade numpy h5py
pip install --upgrade deepfree

feature

fast learning

The main framework of the program relies on Model in core._model and Layer in core._layer, which can import directly through 'from deepfree import Model, Layer'. You can quickly build and train the model by using them flexibly. In addition, the constructed DBN and SAE can be employed directly, which are inherited from Model.

stacking blocks

By calling Model.add_layer(['a Layer of a list of Layer']), you can build the model like stack the blocks. There are a set of Layer can be selected, such as phvariable, maxpooling2d,flatten,concatenate, Dense, Conv2D.

flexible setting

You can set the model's parameters listed in base._attribute when first building model (DBN(para=...), SAE(para=...), Model(para=...)) or training it (Model.training(para=...)). If you do not set a value, the default value in base._attribute will be applied.

results display

'loss & test accuracy - epoch' curve and 'prediction - epoch' curve will be generated automatically. Furthermore, real label -> predicted label count result and t-SNE visualization image can be obtained by calling Model.plot_label_cnt and Model.plot_tSNE, respectively.

example

A simple DNN can be constructed and trained as:

from deepfree import Model
from deepfree import phvariable,Dense
model = Model()
model.struct = [784, 100 ,10]
model.input = phvariable(model.struct[0])('input')
model.label = phvariable(model.struct[-1])('label')

for i in range(len(model.struct)-2):
    model.add_layer(Dense(model.struct[i+1], 
                         activation = model.next_hidden_activation(), 
                         is_dropout = True))
model.add_layer(Dense(model.struct[-1], activation = model.output_func))
model.training(dataset = ...,data_path = ...)

plot

The running result can be find in 'result' folder.

  • loss & test accuracy - epoch curve:
  • prediction - epoch curve:
  • real label -> predicted label count result:
  • t-SNE visualization:

blog

Github, zhihu, CSDN, PyPI
QQ Group:640571839

Project details


Download files

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

Source Distribution

deepfree-0.3.0.tar.gz (20.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

deepfree-0.3.0-py3-none-any.whl (30.1 kB view details)

Uploaded Python 3

File details

Details for the file deepfree-0.3.0.tar.gz.

File metadata

  • Download URL: deepfree-0.3.0.tar.gz
  • Upload date:
  • Size: 20.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.5

File hashes

Hashes for deepfree-0.3.0.tar.gz
Algorithm Hash digest
SHA256 3a05b38f9870382d0fd4e1d6dcad666273d9e9a3ebc12052b99e8de744f036f3
MD5 f3ba39b63e372b8400faf09f793e1350
BLAKE2b-256 e30b4f1da87c5a2501cf12cb651c5bd66d1ac604c677ce0c508ddc9ecba699c6

See more details on using hashes here.

File details

Details for the file deepfree-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: deepfree-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 30.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.5

File hashes

Hashes for deepfree-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 717842ef8bd2da71e803cc649496b2ba27a115531265099695f7adaa4e59ef94
MD5 b5c65536a416754f8c3c4b84368748cb
BLAKE2b-256 9364e350bf11886ab83592fcb3ddd94f3813f262ff69987000802d4180b9ae6e

See more details on using hashes here.

Supported by

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