• Stars
    star
    430
  • Rank 98,858 (Top 2 %)
  • Language
    C#
  • License
    Other
  • Created about 13 years ago
  • Updated over 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Encog Machine Learning Framework

Note: The name "Encog Core" causes some confusion with Microsoft .Net Core. This version of Encog has nothing to do with Microsoft's .Net Core release. I am tempted to change the name of the Repo and NuGet, but that would be a massive breaking change at this point.

Encog Machine Learning Framework

Encog is a pure-Java/C# machine learning framework that I created back in 2008 to support genetic programming, NEAT/HyperNEAT, and other neural network technologies. Originally, Encog was created to support research for my masterโ€™s degree and early books. The neural network aspects of Encog proved popular, and Encog was used by a number of people and is cited by 952 academic papers in Google Scholar. I created Encog at a time when there were not so many well developed frameworks, such as TensorFlow, Keras, DeepLearning4J, and many others (these are the frameworks I work with the most these days for neural networks).

Encog continues to be developed (and bugs fixed) for the types of models not covered by the large frameworks and to provide a pure non-GPU Java/C# implementation of several classic neural networks. Because it is pure Java, the source code for Encog can be much simpler to adapt for cases where you want to implement the neural network yourself from scratch. Some of the less mainstream technologies supported by Encog include NEAT, HyperNEAT, and Genetic Programming. Encog has minimal support for computer vision. Computer vision is a fascinating topic, but just has never been a research interest of mine.

Encog supports a variety of advanced algorithms, as well as support classes to normalize and process data. Machine learning algorithms such as Support Vector Machines, Neural Networks, Bayesian Networks, Hidden Markov Models, Genetic Programming and Genetic Algorithms are supported. Most Encog training algorithms are multi-threaded and scale well to multicore hardware.

Encog continues to be developed, and is used in my own research, for areas that I need Java and are not covered by Keras. However, for larger-scale cutting edge work, where I do not need to implement the technology from scratch, I make use of Keras/TensorFlow for my own work.

Simple C# XOR Example in Encog

using System;
using ConsoleExamples.Examples;
using Encog.Engine.Network.Activation;
using Encog.ML.Data;
using Encog.ML.Data.Basic;
using Encog.ML.Train;
using Encog.Neural.Networks;
using Encog.Neural.Networks.Layers;
using Encog.Neural.Networks.Training.Propagation.Back;
using Encog.Neural.Networks.Training.Propagation.Resilient;

namespace Encog.Examples.XOR
{
    public class XORHelloWorld : IExample
    {
        /// <summary>
        /// Input for the XOR function.
        /// </summary>
        public static double[][] XORInput = {
            new[] {0.0, 0.0},
            new[] {1.0, 0.0},
            new[] {0.0, 1.0},
            new[] {1.0, 1.0}
        };

        /// <summary>
        /// Ideal output for the XOR function.
        /// </summary>
        public static double[][] XORIdeal = {
            new[] {0.0},
            new[] {1.0},
            new[] {1.0},
            new[] {0.0}
        };

        public static ExampleInfo Info
        {
            get
            {
                var info = new ExampleInfo(
                    typeof(XORHelloWorld),
                    "xor",
                    "Simple XOR with backprop, no factories or helper functions.",
                    "This example shows how to train an XOR with no factories or helper functions.");
                return info;
            }
        }

        #region IExample Members

        /// <summary>
        /// Program entry point.
        /// </summary>
        /// <param name="app">Holds arguments and other info.</param>
        public void Execute(IExampleInterface app)
        {
            // create a neural network, without using a factory
            var network = new BasicNetwork();
            network.AddLayer(new BasicLayer(null, true, 2));
            network.AddLayer(new BasicLayer(new ActivationSigmoid(), true, 3));
            network.AddLayer(new BasicLayer(new ActivationSigmoid(), false, 1));
            network.Structure.FinalizeStructure();
            network.Reset();

            // create training data
            IMLDataSet trainingSet = new BasicMLDataSet(XORInput, XORIdeal);

            // train the neural network
            IMLTrain train = new ResilientPropagation(network, trainingSet);

            int epoch = 1;

            do
            {
                train.Iteration();
                Console.WriteLine(@"Epoch #" + epoch + @" Error:" + train.Error);
                epoch++;
            } while (train.Error > 0.01);

            // test the neural network
            Console.WriteLine(@"Neural Network Results:");
            foreach (IMLDataPair pair in trainingSet)
            {
                IMLData output = network.Compute(pair.Input);
                Console.WriteLine(pair.Input[0] + @"," + pair.Input[1]
                                  + @", actual=" + output[0] + @",ideal=" + pair.Ideal[0]);
            }
        }

        #endregion
    }
}

More Repositories

1

t81_558_deep_learning

T81-558: Keras - Applications of Deep Neural Networks @Washington University in St. Louis
Jupyter Notebook
5,671
star
2

aifh

Artificial Intelligence for Humans
Java
909
star
3

encog-java-core

Java
744
star
4

app_deep_learning

T81-558: PyTorch - Applications of Deep Neural Networks @Washington University in St. Louis
Jupyter Notebook
291
star
5

jh-kaggle-util

Jeff Heaton's Kaggle Utilities
Python
279
star
6

encog-javascript

Encog for Javascript.
JavaScript
197
star
7

present

Code from Jeff Heaton's YouTube videos, articles, and conference presentations.
Assembly
173
star
8

encog-java-examples

Java
163
star
9

encog-c

The Encog project for C/C++
C
112
star
10

pyimgdata

Python
107
star
11

jeffheaton-book-code

Source code from my older (pre Artificial Intelligence for Humans books) books. I am no longer updating these older editions.
Java
88
star
12

mergelife

Evolve complex cellular automata with a genetic algorithm.
Python
73
star
13

encog-java-workbench

Java
60
star
14

pretrained-gan-70s-scifi

Pretrained model 1024x1024 trained on 1970s scifi art
Jupyter Notebook
51
star
15

pretrained-gan-minecraft

Minecraft GAN
Jupyter Notebook
44
star
16

encog-dotnet-more-examples

This project will contain additional examples for Encog, beyond the console examples provided with Encog. These examples are primarily Winforms GUI applications, and may make use of third party libraries other than Encog.
C#
43
star
17

docker-stylegan2-ada

My Docker image for running Stylegan2 ADA with GPU
Dockerfile
39
star
18

papers

Repository to hold source code related to academic papers I've published.
Python
30
star
19

encog-sample-csharp

A sample application for Encog C#.
C#
28
star
20

app_generative_ai

T81-559: Applications of Generative Artificial Intelligence
Jupyter Notebook
27
star
21

pretrained-gan-fish

Pretrained model for fish, 256x256
Jupyter Notebook
24
star
22

article-code

Python
23
star
23

stylegan2-toys

Various projects that I've worked on for special effects in StyleGAN2.
Jupyter Notebook
18
star
24

encog-sample-java

Sample stand-alone Encog project
Java
15
star
25

libsvm-java

This is simply a repository to hold the latest libsvm Java, and allow me to track changes. This is not my own project. See homepage URL for source.
14
star
26

pretrained-merry-gan-mas

Jupyter Notebook
13
star
27

docker-jupyter-python-r

Jupyter notebook with Python and R.
Jupyter Notebook
12
star
28

ios_video_classify

A simple IOS application that uses mobilenet to classify 1000 different images from an IOS device's video camera.
Swift
11
star
29

phd-dissertation

Dissertation (Jeff Heaton)
Java
10
star
30

apollo64

หœApollo64 BBS: This is an old Commodore 64 based BBS that I created on back in the late 80's. Basic/6510 assembler.
Assembly
10
star
31

jeffheaton.github.io

The AIFH website.
HTML
10
star
32

proben1

A copy of the datasets for PROBEN1 from the paper "Proben1: A Set of Neural Network Benchmark Problems and Benchmarking Rules", Lutz Prechelt
Perl
10
star
33

mergelife-experiments

Data for several runs of MergeLife
9
star
34

pretrained-gan-tech

Technology GAN
Jupyter Notebook
9
star
35

jeffheaton

8
star
36

pysamppackage

A sample package for Python to learn how to structure a package.
8
star
37

tf-intro

Jupyter Notebook
7
star
38

ga-csharp

A simple C# Genetic Algorithm
C#
7
star
39

encog-silverlight-core

Encog for Silverlight is no longer supported or maintained. Version 3.0 was the last released version.
6
star
40

jlatexmath-example

A simple example of using JLatexMath
Java
6
star
41

stylegan2-cloud

Utilities to run StyleGAN2 ADA Pytorch in the cloud
5
star
42

docker-stylegan3

Docker image to run StyleGAN3 with GPU
Dockerfile
3
star
43

jna-example

Simple Java JNA example with a Maven build script.
Java
3
star
44

jeffheaton-bookcode

Source code from books published by Jeff Heaton
3
star
45

data-mirror

A mirror of some of the files at data.heatonresearch.com
HTML
2
star
46

data

Some common datasets with headers added and properly setup for Pandas/others
2
star
47

jheaton_images

Images that I use for various sites, like Kaggle
2
star
48

baseenv-jupyter

Basic Docker environment for Jupyter and Python
Dockerfile
2
star
49

docker-jupyterhub

My Jupyterhub docker image
2
star
50

cabi_genai_automation

Introduction to Automation with LangChain, Generative AI, and Python
Jupyter Notebook
2
star
51

kaggle-otto-group

Jeff Heaton's Entry for Kaggle Otto Group Product Classification Challenge
1
star
52

jheaton-ds2

Some of my datasets (public)
1
star
53

docker-mergelife

Docker image for MergeLife
Dockerfile
1
star