项目作者: SC4RECOIN

项目描述 :
Keras-style machine learning framework for Java
高级语言: Java
项目地址: git://github.com/SC4RECOIN/Jeras.git
创建时间: 2018-09-21T02:42:01Z
项目社区:https://github.com/SC4RECOIN/Jeras

开源协议:

下载


Jeras

Jeras is a machine learning framework for Java. The motivation for this repository is to better understand the underlying code of neural networks. This is an experimental framework designed to work just like Keras and is just for educational purposes.


Usage

To use Jeras you can either create an instance of a network

  1. int inputs = x.columns;
  2. int hidden1 = 8;
  3. int hidden2 = 8;
  4. int outputs = y.columns;
  5. int epochs = 1000;
  6. float lr = 0.1f;
  7. int[] networkShape = {inputs, hidden1, hidden2, outputs};
  8. MLP nn = new MLP(networkShape, lr);
  9. nn.train(x, y, epochs);
  10. System.out.println(nn.predict(x));

Or use the Sequential syntax just like Keras

  1. int epochs = 5000;
  2. float lr = 0.1f;
  3. Sequential model = new Sequential();
  4. model.add(new Dense(8, "sigmoid", x.columns));
  5. model.add(new Dense(8, "sigmoid"));
  6. model.add(new Dense(y.columns, "softmax"));
  7. model.compile(lr);
  8. model.fit(x, y, epochs);
  9. System.out.println(model.predict(x));

So far I only have Dense layers but plan to implement Convolution layers next.