Search Unity

Observations List or one by one

Discussion in 'ML-Agents' started by mateolopezareal, Jul 2, 2020.

  1. mateolopezareal

    mateolopezareal

    Joined:
    Jun 4, 2020
    Posts:
    54
    Having a list of float called hist
    Code (CSharp):
    1. List<float> hist =histograma.GetListaCompleto();
    Is it better to pass the Observation by a list like this:
    Code (CSharp):
    1. sensor.AddObservation(hist);
    or one by one with a for:
    Code (CSharp):
    1. foreach (float cubo in histograma.getListaCompleto())
    2.         {
    3.             sensor.AddObservation(cubo);
    4.         }
    And also, why can I only pass the list with floats? Does it matter if I pass them as an int (as they are always Integers)?
     
  2. Hsgngr

    Hsgngr

    Joined:
    Dec 28, 2015
    Posts:
    61
    The reason that you have to pass the observation as float is neural networks work weights between 0-1. Therefore your floats will be normalized aka mapped in range(0,1) It is not a good way to feed your neural network with integers because of the normalization.

    Giving as a list or one by one should not change the results.
     
  3. mateolopezareal

    mateolopezareal

    Joined:
    Jun 4, 2020
    Posts:
    54
    So if I have a map of obejcts in which I have to refernce 4 colours, how would you do it?
    It is okay to pass as white: 0, black: 1, green: 2 and red: 3? or should I pass it as 0, 0.25, 0.5, 0.75 and 1?
     
  4. Hsgngr

    Hsgngr

    Joined:
    Dec 28, 2015
    Posts:
    61
  5. mateolopezareal

    mateolopezareal

    Joined:
    Jun 4, 2020
    Posts:
    54
  6. Hsgngr

    Hsgngr

    Joined:
    Dec 28, 2015
    Posts:
    61
    First of all, array with a 144 elements is too much. Try to decrease the element count
     
  7. mateolopezareal

    mateolopezareal

    Joined:
    Jun 4, 2020
    Posts:
    54
    I have to give tha map of the elements int he matrix, that are 144. How can I do it?