# Lesson 6 - Resources

## #

Adding a wordlist in the RunefileIn lesson-2, we look at how to manually add labels in the `args`

property of the `hotg-ai/proc-blocks@label`

proc-block. This will be
a cumbersome process if we have a large number of labels (e.g. the Landmark
model has 100k labels).

Instead of manually adding all those labels in the Runefile, we can provide a
path to the `txt`

or `csv`

files using a resource.

Resources are declared under the Runefile's `resources`

property.

## #

Proc-blocksThe processing block is used to process your data by transforming it from one form to another. We have a list of them over here. You can also create your own proc-block if you need one, or let us know we can help you make one.

### #

1. argmaxThis proc-block returns indices of the max element of the array.

E.g. I got this output after running rune build from the above Runefile. As we can see 2nd index has largest value.

It takes only type `f32`

tensor as input and give back `u32`

tensor as output.
This proc-block get used in the BERT rune.

### #

2. audio_float_conversionMany audio models take in an input of `f32`

. This proc-block convert our input
from an `i16`

data type to a floating-point value.

This proc-block used in the YAMNET rune. You can find more details on this in our article.

### #

3. fftThis proc-block converts a signal from its original domain (often time or space) to a representation in the frequency domain.

This proc-block is used in the `microspeech`

rune. You can find
more detail in our article.

### #

4. image-normalizationWe saw this proc-block in lesson-3. It transform our `u8`

type to `f32`

and
normalize the image matrix in range `[0, 1]`

.

### #

5. labelWe saw this proc-block in lesson-2. A proc block which, when given a set of indices, will return their associated labels.

### #

6. moduloAs the same suggest, it returns the remainder of a division, after one number is divided by another.

This proc-block is used in the `sine`

rune.

### #

7. most_confident_indices.We saw this proc-block in lesson-2. A proc block which, when given a list of confidences, will return the indices of the top N most confident values.

### #

8. noise-filteringThis proc-block perform a couple of functions:

- Reduces noise within each frequency bin (channel)
- Applies a gain control algorithm to each frequency bin (channel)
- Applies log2 function and scales the output.

This proc-block is used in the microspeech rune. You can find more detail in our article.

### #

9. normalizeThis proc-block normalize the input to the range `[0, 1]`

.

This proc-block is used in the `gesture`

rune.

### #

10. parseA proc block which can parse a string to numbers. This proc-block could be helpful in doing non-ML tasks.

After building a rune using above Runefile run ```
rune run test.rune --raw
input.txt
```

, where input .txt contains `1 2 3 4 5`

. You will get this as output.

P.S. Keep capability dimension a bit a bit larger rune will automatically adjust it.

### #

11. segment_outputThis proc-block is useful in image segmentation. A proc-block which takes a rank
4 `tensor`

as input, whose dimension is of this form `[1, x, y, z]`

. It will
return:

- a 2-d
`tensor`

after performing argmax along the axis-3 of the tensor - a 1-d
`tensor`

which a`set`

of all the number present in the above 2-d`tensor`

We use this in the `deep_lab`

rune.

### #

12. softmaxA proc-block which apply softmax function over the tensor list.

### #

13. tokenizersThis proc-block is helpful in the NLP models. Tokenization is a way of separating a piece of text into smaller units called tokens (e.g. bert tokenizer).

we use this in bert rune. You can find more details in our article.

### #

14. utf8_decodeA proc block which can convert u8 bytes to utf8.

After building a rune using above Runefile run ```
rune run test.rune --raw
input.txt
```

, where input .txt contains `one two three four five`

. You will get
this as output.

The `capability`

convert the input data to `u8`

bytes so we can use this
proc-block to convert them back to `utf8`