Spaces:
Sleeping
Sleeping
Download fuel_learning.h from sok99/bigcode-starcoder2-15b: direct link, hf CLI and curl.
- Browser
- Download file 1.71 kB
-
https://huggingface.co/spaces/sok99/bigcode-starcoder2-15b/resolve/refs%2Fpr%2F1/fuel_learning.h
- Command line
-
hf download hf://spaces/sok99/bigcode-starcoder2-15b@refs/pr/1/fuel_learning.h
-
curl -L -o fuel_learning.h https://huggingface.co/spaces/sok99/bigcode-starcoder2-15b/resolve/refs%2Fpr%2F1/fuel_learning.h
1.71 kB
| // Размеры таблиц обучения | |
| class FuelLearningTable { | |
| private: | |
| float cells[LOAD_POINTS][RPM_POINTS]; // Таблица коррекции | |
| float loadPoints[LOAD_POINTS]; // Точки по нагрузке (кПа) | |
| float rpmPoints[RPM_POINTS]; // Точки по оборотам | |
| float learningRate; // Скорость обучения | |
| float maxCorrection; // Максимальная коррекция | |
| float minCorrection; // Минимальная коррекция | |
| // Вспомогательные методы | |
| int findNearestIndex(float value, const float* points, int size); | |
| float interpolate2D(float load, float rpm); | |
| void updateCell(int loadIdx, int rpmIdx, float correction); | |
| public: | |
| FuelLearningTable(); | |
| // Основные методы | |
| void begin(); | |
| float getCorrection(float load, float rpm); | |
| void learn(float load, float rpm, float lambdaError); | |
| void reset(); | |
| // Методы сохранения/загрузки | |
| bool save(); | |
| bool load(); | |
| // Настройка параметров | |
| void setLearningRate(float rate); | |
| void setCorrectionLimits(float min, float max); | |
| // Доступ к данным для визуализации | |
| float getCellValue(int loadIdx, int rpmIdx); | |
| float getLoadPoint(int idx); | |
| float getRPMPoint(int idx); | |
| }; | |