feat: Enhance Header component to improve active link detection
- Updated the `isActive` function in `Header.jsx` to handle root path and include logic for other paths. chore: Update package-lock.json to remove peer dependencies - Removed unnecessary peer dependencies from various packages in `package-lock.json`. feat: Update frameworks.json to include example links - Changed `exemplo_codigo` to `exemplo` and added `exemplos` links for various frameworks in `frameworks.json`. feat: Add placa images to series.json - Included image paths for different ESP32 series in `series.json`. feat: Create CodeExample component for displaying code snippets - Added a new `CodeExample.jsx` component to fetch and display code examples dynamically. feat: Add example Arduino code for Wi-Fi connection - Created `arduino.ino` example for connecting to Wi-Fi. feat: Add example code for audio playback using ESP-ADF - Created `esp-adf.c` example for audio playback using ESP-ADF. feat: Add example code for DSP operations - Created `esp-dsp.c` example demonstrating basic DSP operations. feat: Add example code for ESP-IDF LED blinking - Created `esp-idf.c` example for blinking an LED using ESP-IDF. feat: Add example code for Matter integration - Created `esp-matter.c` example for Matter device initialization and event handling. feat: Add example code for neural network operations - Created `esp-nn.c` example demonstrating basic neural network operations. feat: Add example code for face detection using ESP-WHO - Created `esp-who.c` example for face detection using ESP-WHO library. feat: Add MicroPython example for LED blinking - Created `micropython.py` example for blinking an LED using MicroPython.
This commit is contained in:
1 parent
3a5608d1de
commit
2a6699bbfb
18 files changed
+641
-112
No files matched your search
@@ -0,0 +1,44 @@
|
||||
#include <stdio.h>
|
||||
#include "esp_nn.h"
|
||||
#include "esp_nn_defs.h"
|
||||
|
||||
#define INPUT_SIZE 4
|
||||
#define OUTPUT_SIZE 3
|
||||
|
||||
void print_array(const char *label, int16_t *array, int size) {
|
||||
printf("%s: ", label);
|
||||
for (int i = 0; i < size; i++) {
|
||||
printf("%d ", array[i]);
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
void app_main(void)
|
||||
{
|
||||
// Vetor de entrada (ex: saída de uma camada anterior)
|
||||
int16_t input[INPUT_SIZE] = {1, 2, 3, 4};
|
||||
|
||||
// Pesos da camada densa (3x4)
|
||||
int8_t weights[OUTPUT_SIZE * INPUT_SIZE] = {
|
||||
1, -1, 2, 0,
|
||||
0, 1, -1, 1,
|
||||
2, 0, 1, -2
|
||||
};
|
||||
|
||||
// Bias de cada neurônio
|
||||
int16_t bias[OUTPUT_SIZE] = {10, -5, 0};
|
||||
|
||||
// Saída
|
||||
int16_t output[OUTPUT_SIZE];
|
||||
|
||||
// Multiplicação da matriz: output = weights * input + bias
|
||||
esp_nn_mul_mat_16x8_16(weights, input, bias, output,
|
||||
OUTPUT_SIZE, INPUT_SIZE, /*shift=*/0);
|
||||
|
||||
print_array("Antes da ReLU", output, OUTPUT_SIZE);
|
||||
|
||||
// Aplicar função de ativação ReLU
|
||||
esp_nn_relu_16(output, OUTPUT_SIZE);
|
||||
|
||||
print_array("Depois da ReLU", output, OUTPUT_SIZE);
|
||||
}
|
||||
Reference in new issue
Block a user