Giter Site home page Giter Site logo

rootharold / lycoris Goto Github PK

View Code? Open in Web Editor NEW
177.0 1.0 2.0 2.85 MB

A lightweight and easy-to-use deep learning framework with neural architecture search.

License: Other

CMake 2.74% C++ 97.26%
deep-learning lycoris online-learning neural-architecture-search machine-learning python python-bindings

lycoris's Introduction

logo

Lycoris is a lightweight and easy-to-use deep learning framework with neural architecture search.

Lycoris aims to provide developers with an automated service for end-to-end neural network architecture search, enabling developers to obtain better models with fewer hyperparameter configurations. For more detailed usage of Lycoris, please refer to related documents.

At this stage, Lycoris enables you to deploy computation to one or more CPUs in most operating systems. In the future, GPUs will be added to the minimalist architecture.

Features

  • Lightweight and portable to smart devices.
  • Support online learning.
  • Automatic neural network architecture search.
  • Support for Python. In the near future, other programming languages such as Java, C #, Go, and Rust will be supported.
  • Cloud-friendly. Based on C++11, it supports most operating systems and compilers.

Installation

  • C++ version:
cd Lycoris
cmake .
sudo make install
  • Python bindings:

The Python bindings of the code are based on Pybind11.

git clone "https://github.com/pybind/pybind11.git"
cd pybind11
mkdir build
cd build
cmake ..
make install

(If pybind11 and its header files are already installed, you can ignore the above steps.)

pip install LycorisNet

It can also be obtained via manual compilation:

cd Lycoris/python
cmake .
make

Documents

The following is the documentation for the C ++ version while that of the Python version can be viewed here.

The APIs provided by Lycoris (namespace LycorisNet):

Function Description Inputs Returns
Lycoris(uint32_t capacity, uint32_t inputDim, uint32_t outputDim, const std::string &mode); Constructor.
The class Lycoris is the highest level abstraction of LycorisNet.
capacity: Capacity of Lycoris.
inputDim: Input dimension.
outputDim: Output dimension.
mode: Mode of Lycoris (classify or predict).
An object of the class Lycoris.
~Lycoris(); Destructor.
void preheat(uint32_t num_of_nodes, uint32_t num_of_connections, uint32_t depth); Preheating process of the neural network cluster. num_of_nodes: The number of hidden nodes added for each neural network.
num_of_connections: The number of connections added for each neural network.
depth: Total layers of each neural network.
void evolve(std::vector<std::vector<float> > &input, std::vector<std::vector<float> > &desire); Evolve the neural network cluster. input: Input data.
desire: Expected output data.
void fit(std::vector<std::vector<float> > &input, std::vector<std::vector<float> > &desire); Fit all neural networks in the neural network cluster. input: Input data.
desire: Expected output data.
void enrich(); Keep only the best one in the neural network cluster.
std::vector<float> compute(std::vector<float> &input); Forward Computing of the best individual. input: Input data. Returns the output data.
std::vector<std::vector<float> > computeBatch(std::vector<std::vector<float> > &input); Parallel forward Computing of the best individual. input: Input data (two dimensions). Returns the output data (two dimensions).
void resize(uint32_t capacity); Resize the capacity of the neural network cluster. As literally.
void openMemLimit(uint32_t size); Turn on memory-limit. As literally.
void closeMemLimit(); Turn off memory-limit.
void saveModel(const std::string &path); Export the current trained model. path: File path of the current trained model.
void setMutateArgs(std::vector<float> &p); Set p1 to p4 in the class Args.
Parameters are passed in as std::vector.
p1: Probability of adding the new node between a connection.
p2: Probability of deleting a node.
p3: Probability of adding a new connection between two nodes.
p4: Probability of deleting a connection.
void setMutateOdds(float odds); Set the odds of mutating. The param "odds" means one individual mutates odds times to form odds + 1 individuals.
void setCpuCores(uint32_t num); Set the number of worker threads to train the model. As literally.
void setLR(float lr); Set the learning rate. As literally.
uint32_t getSize(); Returns the size of the best individual.
uint32_t getInputDim(); Returns the input dimension.
uint32_t getOutputDim(); Returns the output dimension.
uint32_t getCapacity(); Returns capacity of Lycoris.
float getLoss(); Returns the loss.
std::string getMode(); Returns mode of Lycoris (classify or predict).
std::vector<uint32_t> getLayers(); Returns the number of nodes in each layer of the neural network.
std::vector<float> getHiddenLayer(uint32_t pos); The parameter pos starts at index 0. pos: The number of the layer needed. Returns a vector of nodes in a specific layer of the best individual.
static std::string version(); Returns version information and copyright information.

The funtion used to import the pre-trained model (namespace LycorisNet):

Function Description Inputs Returns
Lycoris *loadModel(const std::string &path, uint32_t capacity); Import the pre-trained model. path: File path of the pre-trained model.
capacity: Capacity of the neural network cluster.
Returns a pointer to the object of class Lycoris.
Lycoris *loadViaString(const std::string &model, uint32_t capacity); Import the pre-trained model via string. model: The pre-trained model in the form of string.
capacity: Capacity of the neural network cluster.
Returns a pointer to the object of class Lycoris.

More detailed documentation will be released in the form of sample code.

Examples

  • LycorisAD: an elegant outlier detection algorithm framework based on AutoEncoder.
  • LycorisR: a lightweight recommendation algorithm framework based on LycorisNet.
  • LycorisQ: a neat reinforcement learning framework based on LycorisNet.
  • More examples will be released in the future.

License

Lycoris is released under the LGPL-3.0 license. By using, distributing, or contributing to this project, you agree to the terms and conditions of this license.

lycoris's People

Contributors

rootharold avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

develon2015

lycoris's Issues

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.