Samyssmile / edux

EDUX is a developer friendly Java library for machine learning educational tasks
https://samyssmile.github.io/edux/
Apache License 2.0
47 stars 16 forks source link

Make Weight Initialization configurable #153

Open Samyssmile opened 10 months ago

Samyssmile commented 10 months ago

Educational

https://towardsdatascience.com/weight-initialization-techniques-in-neural-networks-26c649eb3b78

Task

e.g. our DenseLayer implement the HE-Weight Initialization. In some cases its better to use XAVIER

  private void initialize() {
    double standartDeviation = Math.sqrt(2.0 / (weights.get().getRows() + weights.get().getCols()));

    for (int i = 0; i < weights.get().getRows(); i++) {
      for (int j = 0; j < weights.get().getCols(); j++) {
        weights.get().set(i, j, random.nextGaussian() * standartDeviation);
      }
    }
    for (int i = 0; i < bias.get().getRows(); i++) {
      for (int j = 0; j < bias.get().getCols(); j++) {
        bias.get().set(i, j, 0);
      }
    }
  }

We want to make user decide what kind of initialization he want to use. XAVIER or HE.

manumafe98 commented 10 months ago

I would like to try on this one as well!

manumafe98 commented 10 months ago

Hi @Samyssmile where can we discuss about this one? I'm having a bit trouble on knowing how to start. This Initialization is related to the task?

Samyssmile commented 10 months ago

We have our Discord Chat: https://discord.gg/9aD4pDTQ @manumafe98

manumafe98 commented 10 months ago

Joined!