Skip to content

Commit

Permalink
Nicki Minaj Model commaai#28218
Browse files Browse the repository at this point in the history
  • Loading branch information
FrogAi committed May 18, 2023
1 parent ced38b1 commit ef6504d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
11 changes: 6 additions & 5 deletions selfdrive/modeld/models/driving.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
#pragma once

// gate this here
#define TEMPORAL
#define DESIRE
#define TRAFFIC_CONVENTION

#include <array>
#include <memory>

Expand All @@ -17,6 +12,12 @@
#include "selfdrive/modeld/models/nav.h"
#include "selfdrive/modeld/runners/run.h"

// gate this here
#define TEMPORAL
#define DESIRE
#define TRAFFIC_CONVENTION
#define NAV

constexpr int FEATURE_LEN = 128;
constexpr int HISTORY_BUFFER_LEN = 99;
constexpr int DESIRE_LEN = 8;
Expand Down
Binary file modified selfdrive/modeld/models/supercombo.onnx
Binary file not shown.
15 changes: 7 additions & 8 deletions selfdrive/modeld/runners/thneedmodel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,24 +41,24 @@ void ThneedModel::addExtra(float *extra_input_buf, int buf_size) {
}

void* ThneedModel::getInputBuf() {
if (use_extra && thneed->input_clmem.size() > 4) return &(thneed->input_clmem[4]);
else if (!use_extra && thneed->input_clmem.size() > 3) return &(thneed->input_clmem[3]);
if (use_extra && thneed->input_clmem.size() > 5) return &(thneed->input_clmem[5]);
else if (!use_extra && thneed->input_clmem.size() > 4) return &(thneed->input_clmem[4]);
else return nullptr;
}

void* ThneedModel::getExtraBuf() {
if (thneed->input_clmem.size() > 3) return &(thneed->input_clmem[3]);
if (thneed->input_clmem.size() > 4) return &(thneed->input_clmem[4]);
else return nullptr;
}

void ThneedModel::execute() {
if (!recorded) {
thneed->record = true;
if (use_extra) {
float *inputs[5] = {recurrent, trafficConvention, desire, extra, input};
float *inputs[6] = {recurrent, navFeatures, trafficConvention, desire, extra, input};
thneed->copy_inputs(inputs);
} else {
float *inputs[4] = {recurrent, trafficConvention, desire, input};
float *inputs[5] = {recurrent, navFeatures, trafficConvention, desire, input};
thneed->copy_inputs(inputs);
}
thneed->clexec();
Expand All @@ -68,12 +68,11 @@ void ThneedModel::execute() {
recorded = true;
} else {
if (use_extra) {
float *inputs[5] = {recurrent, trafficConvention, desire, extra, input};
float *inputs[6] = {recurrent, navFeatures, trafficConvention, desire, extra, input};
thneed->execute(inputs, output);
} else {
float *inputs[4] = {recurrent, trafficConvention, desire, input};
float *inputs[5] = {recurrent, navFeatures, trafficConvention, desire, input};
thneed->execute(inputs, output);
}
}
}

0 comments on commit ef6504d

Please sign in to comment.