GithubHelp home page GithubHelp logo

elixir-ml-example's Introduction

Convolutional Neural Net in Elixir

In this repository we demonstrate the use of various machine learning tools offered by the Elixir ecosystem. Using these tools, we build, train and test a simple convolutional neural network for detecting pneumonia in x-ray chest scans. You can learn more about this repositor in our blog post focused on machine learning with Elixir.

Following Elixir libraries and projects are used:

  • Livebook: Elixir equivalent of Jupyter Notebook
  • Nx: Multidimensional arrays for Elixir (similar to Python's NumPy)
  • EXLA: Client library for Google's XLA compiler
  • Axon: Neural networks for Elixir

Installation

This guide assumes you already have Elixir installed on your machine. You also need Bazel 3.7.2 to build Tensorflow from source. We recommend installing this specific version with asdf.

  1. Clone Livebook repo:
$ git clone https://github.com/livebook-dev/livebook.git
$ cd livebook
  1. Add following dependencies to the mix.exs file:
{:exla, "~> 0.1.0-dev", github: "elixir-nx/nx", sparse: "exla"},
{:nx, "~> 0.1.0-dev", github: "elixir-nx/nx", sparse: "nx", override: true},
{:axon, "~> 0.1.0-dev", github: "elixir-nx/axon"}
  1. Install and compile the dependencies with mix:
$ mix deps.get
$ mix deps.compile

Accessing the livebook notebooks

  1. Clone this repo inside the livebook directory
$ git clone [email protected]:profiq/elixir-ml-example.git
  1. Start the livebook server
$ mix phx.server

By default, the server will listen on port 4000. You can access it in your browser on [http://localhost:4000]. There you can open the elixir-ml-example/train.livemd notebook. Executing all elixir cells results in training and storing the model in a file. To test the model you can then open the elixir-ml-example/test.livemd notebook.

Dataset

We use the Chest X-Ray Images (Pneumonia) dataset from Kaggle. This repository contains its preprocessed version in a binary format.

elixir-ml-example's People

Contributors

msvana avatar petrvecera 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.