Code Monkey home page Code Monkey logo

imlp's Introduction

interval Multilayer Perceptron

Interval Multilayer Perceptron is a method which implements multilayer perceptron with interval-valued inputs and interval-valued outputs. This package is based on the paper, iMLP: Applying multi-layer perceptrons to interval-valued data, AM San Roque.

Usage

from imlp import iAct, iLoss, get_model
import numpy as np

# Generate the synthetic data
x1 = np.sin(np.arange(0, 9, 0.01))
x2 = np.cos(np.arange(0, 9, 0.01))
x3 = x1**2
x4 = (x1+x2)/2
tmp = np.ones((900,))

Xtrain_c = x3[0:5]
Xtrain_r = tmp[0:5]
Ytrain_c = x4[0:1]
Ytrain_r = tmp[0:1]

for i in range(1,100):
    Xtrain_c = np.vstack((Xtrain_c, x3[i:i+5]))
    Xtrain_r = np.vstack((Xtrain_r, tmp[i:i+5]))
    Ytrain_c = np.vstack((Ytrain_c, x4[i:i+1]))
    Ytrain_r = np.vstack((Ytrain_r, tmp[i:i+1]))

# Parameters
input_dim = 5
output_dim = 1
num_hidden_layers = 2
num_units = [200, 200]
act = ['relu', 'relu']
beta = 0.5  # control the balance between center and radius in loss function

# Get model
model = get_model(input_dim, output_dim, num_units, act, beta, num_hidden_layers)

# Train
model.fit(x=[Xtrain_c, Xtrain_r], y=[Ytrain_c, Ytrain_r], epochs=10)

Structure of the iMLP

kernel function

Hidden layer

kernel function

Activation function

kernel function

Loss function

kernel function

imlp's People

Contributors

kaishxu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.