Skip to main content

Data Generation for Neural Network Playground of Deep Insider

Project description

playground-data

Data Generation for Neural Network Playground of Deep Insider.

This project/package that exists as an aid to the Nerural Network Playground - Deep Insider which was forked from tensorflow/playground: Deep playground.

Official pages

Requirements

  • Python 2: 2.7+ | Python 3: 3.4, 3.5, 3.6+
  • numpy
  • matplotlib

Install this package using pip

pip install playground-data

Usage

print('Import plygdata package as pg')

import plygdata as pg

# Or, you can 'import' class directly like this:
# from plygdata.datahelper import DataHelper, DatasetType
# from plygdata.dataset import DataGenerator
print('Code for plotting sample graph')

#dir(pg.DataHelper)    # How to find class members
#dir(pg.DataGenerator)

dir(pg.DatasetType)
#['ClassifyCircleData',
# 'ClassifySpiralData',
# 'ClassifyTwoGaussData',
# 'ClassifyXORData',
# 'RegressGaussian',
# 'RegressPlane',
# ...]

pg.DataHelper.plot_sample(pg.DatasetType.ClassifyCircleData)
print('Basic code for generating and graphing data')

data_noise=0.0
test_data_ratio = 0.5

# Generate data
data_array = pg.DataGenerator.classify_two_gauss(noise=data_noise)
#data_array = pg.DataGenerator.classify_circle(noise=data_noise)
#data_array = pg.DataGenerator.classify_spiral(noise=data_noise)
#data_array = pg.DataGenerator.classify_xor(noise=data_noise)
#data_array = pg.DataGenerator.regress_gaussian(noise=data_noise)
#data_array = pg.DataGenerator.regress_plane(noise=data_noise)

# Divide the data for training and testing at a specified ratio (further, separate each data into Coordinate point data part and teacher label part)
X_train, y_train, X_test, y_test = pg.DataHelper.split_train_test_x_data_label(data_array, test_size=test_data_ratio)

# Plot the data on the standard graph for Playground
fig, ax = pg.DataHelper.plot_with_playground_style(X_train, y_train, X_test, y_test)
print('Signature of main @staticmethod')

import inspect

inspect.signature(pg.DataHelper.plot_sample)
# <Signature (X_train:list, y_train:list, X_test:list=None, y_test:list=None, figsize:tuple=(5, 5), dpi:int=100)>

inspect.signature(pg.DataGenerator.classify_two_gauss)
# <Signature (noise:float=0.0, numSamples:int=500) -> list>

inspect.signature(pg.DataHelper.split_train_test_x_data_label)
# <Signature (data:list, test_size:float=0.5) -> (<class 'list'>, <class 'list'>, <class 'list'>, <class 'list'>)>

inspect.signature(pg.DataHelper.plot_with_playground_style)
# <Signature (X_train:list, y_train:list, X_test:list=None, y_test:list=None, figsize:tuple=(5, 5), dpi:int=100)>
print('Imported "playground-data" package version is ...')

print(pg.__version__)

License

Copyright 2018 Digital Advantage Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0.

The licenses of using open-source code

This project uses the JavaScript-to-Python-translation of the following open-source code:

Deep playground/src/dataset.ts
Copyright 2016 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0.

d3/d3-scale/linear.js
Copyright 2010-2015 Mike Bostock. All rights reserved.
Licensed under the BSD 3-Clause "New" or "Revised" License.

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

playground-data-0.6.0.tar.gz (14.3 kB view details)

Uploaded Source

File details

Details for the file playground-data-0.6.0.tar.gz.

File metadata

  • Download URL: playground-data-0.6.0.tar.gz
  • Upload date:
  • Size: 14.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.7.0

File hashes

Hashes for playground-data-0.6.0.tar.gz
Algorithm Hash digest
SHA256 2ec844b6b1cb81419071cfff2b94a184b5f042a75cf4c3f5eaae7c2e71c53e0b
MD5 e29d733296bc865330d14b5c253b1c9d
BLAKE2b-256 a21d78a1ddc8a9a1eb85b62dce9c08c8803f310d01aed76802ffcfdc8b25bd99

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