pmanion0 / cs224n-pa4

GitHub repository for CS224n's PA4 - Neural Network for Named Entity Recognition
0 stars 0 forks source link

Testing: Deeper Hidden Layers #44

Closed pmanion0 closed 8 years ago

pmanion0 commented 8 years ago

Testing for a few different combinations of hidden layer size + depth.

Tasks:

dxl0632 commented 8 years ago

@theforager How do I set depth?

hiddendim: 10, 20

Looks like so

  public void setHiddenDimensions(String dimString) {
    String[] splitString = dimString.split(PARAMETER_DELIMITER);
    int[] dims = new int[splitString.length];
    for (int i=0; i < splitString.length; i++)
      dims[i] = Integer.valueOf(splitString[i]);
    setHiddenDimensions(dims);
  }
pmanion0 commented 8 years ago

I think it will work that way, but try it without spaces to be safe (e.g. hiddendim: 10,20).

  private final String PARAMETER_DELIMITER = ",";
...
  public void setHiddenDimensions(String dimString) {
    String[] splitString = dimString.split(PARAMETER_DELIMITER);
    int[] dims = new int[splitString.length];
    for (int i=0; i < splitString.length; i++)
      dims[i] = Integer.valueOf(splitString[i]);
    setHiddenDimensions(dims);
  }
dxl0632 commented 8 years ago
----optimal Run
  train:      ../data/train
  test:       ../data/dev
  wordvec:    ../data/wordVectors.txt
  vocab:      ../data/vocab.txt
  windowsize: 5
  wordvecdim: 50
  lowcaseall: true
  hiddendim:  50,50
  learnwordvec: true
  lambda:     0.001
  iters:      20
  trainevalfreq: 1
  learnrate:  0.03
----
  hiddendim: 50,150
----
  hiddendim: 50,300
----
  hiddendim: 100,50
----
  hiddendim: 100,150
----
  hiddendim: 100,300
----
dxl0632 commented 8 years ago

image

A two-layer NN performs better than only single layer. But more layers doesn't mean better performance. This is only applicable this particular task and of course, I haven't tuned the parameter space exhaustively.