profile
viewpoint

google/gemmlowp 1260

Low-precision matrix multiplication

petewarden/dstk 1066

A collection of the best open data sets and open-source tools for data science

petewarden/c_hashmap 431

A simple string hashmap in C

petewarden/dstkdata 150

The (large) data files needed for the Data Science Toolkit project

google/stm32_bare_lib 117

System functions and example code for programming the "Blue Pill" STM32-compatible micro-controller boards.

petewarden/findbyemail 104

A PHP module that incorporates all known APIs that map an email address to user information

petewarden/buzzprofilecrawl 90

A simple script to crawl Google Profile pages and extract their information as structured data

petewarden/extract_loudest_section 72

Trims .wav audio files to the loudest section of a given length

petewarden/crunchcrawl 42

A project to gather, analyze and visualized the data in Crunchbase

petewarden/catdoc 39

Command-line utility for converting Microsoft Word documents to text

issue commenttensorflow/tensorflow

Feature request: Test in cl_build for the esp32

Thanks for the request! It would be great to have this support for continuous integration builds, so we can make sure that changes don't break the ESP32 version of the library. Unfortunately we don't have anybody internal working on this yet, but I will also ping Espressif to see if this is something they can help with.

hpssjellis

comment created time in 18 hours

PullRequestReviewEvent

push eventpetewarden/picoproto

yksten

commit sha 10fd125fd5df206a35b3623f4e2aa41bd3f083f4

Update picoproto.cc

view details

Pete Warden

commit sha 2e3596ddd840f0dbbd69fb437c4163b9e4025916

Merge pull request #1 from yksten/master Update picoproto.cc

view details

push time in 25 days

PR merged petewarden/picoproto

Update picoproto.cc
+1 -1

0 comment

1 changed file

yksten

pr closed time in 25 days

PullRequestReviewEvent
PullRequestReviewEvent

pull request commenttensorflow/tensorflow

Add symmetric int16 support to tflu softmax reference kernel

@njeffrie could you take a look if you get a chance? Thanks!

sicong-li-arm

comment created time in a month

Pull request review commenttensorflow/tensorflow

Add symmetric int16 support to tflu softmax reference kernel

 TfLiteStatus CalculateSoftmaxParams(TfLiteContext* context,  }  // namespace +void* SoftmaxInit(TfLiteContext* context, const char* buffer, size_t length) {+  TFLITE_DCHECK(context->AllocatePersistentBuffer != nullptr);+  void* raw_op_data =+      context->AllocatePersistentBuffer(context, sizeof(SoftmaxOpData));+  if (raw_op_data == nullptr) {+    return nullptr;+  }+  SoftmaxOpData* op_data = static_cast<SoftmaxOpData*>(raw_op_data);+  const TfLiteType input_type = context->tensors[0].type;

@njeffrie it looks like this is related to the EvalTensors changes?

sicong-li-arm

comment created time in 2 months

pull request commenttensorflow/tensorflow

Add symmetric int16 support to tflu softmax reference kernel

Could you add a float variant of the gen_lut function? I'd imagine that will be a lot faster on the Cortex M cores, since they only support single precision. Thanks!

sicong-li-arm

comment created time in 2 months

Pull request review commenttensorflow/tensorflow

Support quantized int8 and uint8 in TFLu mean operator

 void TestMeanFloatInput4D(const int* input_dims_data, const float* input_data,                             output_data, output_dims_count, params, tolerance)); } +template <typename T>+void TestMeanOpQuantized(const int* input_dims_data, const float* input_data,+                         float input_scale, int input_zero_point,+                         const int* axis_dims_data, const int32_t* axis_data,+                         const int* output_dims_data,+                         const float* expected_output_data, float output_scale,+                         int output_zero_point, TfLiteReducerParams* params) {+  // Convert dimesion arguments to TfLiteArrays+  TfLiteIntArray* input_dims = IntArrayFromInts(input_dims_data);+  TfLiteIntArray* axis_dims = IntArrayFromInts(axis_dims_data);+  TfLiteIntArray* output_dims = IntArrayFromInts(output_dims_data);++  // Get number of elements in input and output tensors+  const int output_dims_count = ElementCount(*output_dims);+  const int input_dims_count = ElementCount(*input_dims);++  // Allocate arrays for quantized tensors+  T* output_data_quant = new T[output_dims_count];

Sorry for the delay. I'd actually recommend you pass in the output data array as an argument into the function, since the calling code will know the size needed as a constant. It's a bit less convenient, but not all of our platforms support memory allocation, so we can't use new/malloc/etc.

patriklaurell

comment created time in 2 months

Pull request review commenttensorflow/tensorflow

port TF Lite micro speech example to CEVA-DSP BX1

+++#include <stdio.h>+#include <stdlib.h>+#include <fstream>+#include <iostream>+#include "tensorflow/lite/micro/examples/micro_speech/audio_provider.h"+#include "tensorflow/lite/micro/examples/micro_speech/command_responder.h"+#include "tensorflow/lite/micro/examples/micro_speech/feature_provider.h"+#include "tensorflow/lite/micro/examples/micro_speech/micro_features/micro_model_settings.h"+#include "tensorflow/lite/micro/examples/micro_speech/recognize_commands.h"+#include "tensorflow/lite/schema/schema_generated.h"+#include "micro_interpreter.h"+#include "tensorflow/lite/micro/examples/micro_speech/micro_features/tiny_conv_micro_features_model_data.h"+#include "lite/version.h"+#include "micro_mutable_op_resolver.h"++constexpr int kNoOfSamples = 512;+bool g_is_audio_initialized = false;+constexpr int kAudioCaptureBufferSize = kAudioSampleFrequency * 0.5;+int16_t g_audio_capture_buffer[kAudioCaptureBufferSize];+int16_t g_audio_output_buffer[kMaxAudioSampleSize];+int32_t g_latest_audio_timestamp = 0;++int16_t audio[513];+int scores_count[4] = {0};++++char filename[50] = "input.wav";+FILE *infile;++void setup_tf();+void CaptureSamples(const int16_t* sample_data);+int detection_loop();+extern "C"{+void setup()+{+	//open audio input (a file in this case)+	//init TF++	uint8_t mem[3];+	printf("Using filename %s\n", filename);++	//int ret = 0;++	infile = fopen(filename,"rb");++	//skip wav header+	for (int i = 0; i < 44; i++)+	{+		fread(mem,1,1,infile);+	}++	setup_tf();+}+}++void read_samples()+{+	int i =0;+	uint8_t mem[3];+	bool done;+	for (int i = 0; i < kNoOfSamples; i++)+	{+		if (fread( (char*)mem,1,2,infile ) == 2 )+		{+			audio[i] = (int16_t)mem[0] + (((int16_t)mem[1]) << 8);+		}+		else {+			done = true;+			fclose(infile);+			infile = fopen(filename,"rb");+			//printf("EOF reached\n");++			break;+			}+		}+}+extern "C"{+void loop()+{+	//get audio samples+	//run detection+	read_samples();+	CaptureSamples(audio);+	detection_loop();+}+}++void CaptureSamples(const int16_t* sample_data) {+  const int sample_size = kNoOfSamples;+  const int32_t time_in_ms =+      g_latest_audio_timestamp + (sample_size / (kAudioSampleFrequency / 1000));++  const int32_t start_sample_offset =+      g_latest_audio_timestamp * (kAudioSampleFrequency / 1000);++  for (int i = 0; i < sample_size; ++i) {+    const int capture_index =+        (start_sample_offset + i) % kAudioCaptureBufferSize;+    g_audio_capture_buffer[capture_index] = sample_data[i];+  }+  // This is how we let the outside world know that new audio data has arrived.+  g_latest_audio_timestamp = time_in_ms;+}++// Main entry point for getting audio data.+TfLiteStatus GetAudioSamples(tflite::ErrorReporter* error_reporter,+                             int start_ms, int duration_ms,+                             int* audio_samples_size, int16_t** audio_samples) {+  if (!g_is_audio_initialized) {+       g_is_audio_initialized = true;+  }+  // This should only be called when the main thread notices that the latest+  // audio sample data timestamp has changed, so that there's new data in the+  // capture ring buffer. The ring buffer will eventually wrap around and+  // overwrite the data, but the assumption is that the main thread is checking+  // often enough and the buffer is large enough that this call will be made+  // before that happens.+  const int start_offset = start_ms * (kAudioSampleFrequency / 1000);+  const int duration_sample_count =+      duration_ms * (kAudioSampleFrequency / 1000);+  for (int i = 0; i < duration_sample_count; ++i) {+    const int capture_index = (start_offset + i) % kAudioCaptureBufferSize;+    g_audio_output_buffer[i] = g_audio_capture_buffer[capture_index];+  }+  *audio_samples_size = kMaxAudioSampleSize;+  *audio_samples = g_audio_output_buffer;+  return kTfLiteOk;+}++int32_t LatestAudioTimestamp() { return g_latest_audio_timestamp; }++namespace tflite {+namespace ops {+namespace micro {+TfLiteRegistration* Register_DEPTHWISE_CONV_2D();+TfLiteRegistration* Register_FULLY_CONNECTED();+TfLiteRegistration* Register_SOFTMAX();+}  // namespace micro+}  // namespace ops+}  // namespace tflite++short *g_model16;+++// Globals, used for compatibility with Arduino-style sketches.+namespace {+tflite::ErrorReporter* error_reporter = nullptr;+const tflite::Model* model = nullptr;+tflite::MicroInterpreter* interpreter = nullptr;+TfLiteTensor* model_input = nullptr;+FeatureProvider* feature_provider = nullptr;+RecognizeCommands* recognizer = nullptr;+int32_t previous_time = 0;++// Create an area of memory to use for input, output, and intermediate arrays.+// The size of this will depend on the model you're using, and may need to be+// determined by experimentation.+constexpr int kTensorArenaSize = 10 * 1024;+uint8_t tensor_arena[kTensorArenaSize];+}  // namespace++++// The name of this function is important for Arduino compatibility.+void setup_tf() {+  // Set up logging. Google style is to avoid globals or statics because of+  // lifetime uncertainty, but since this has a trivial destructor it's okay.+  // NOLINTNEXTLINE(runtime-global-variables)+  static tflite::MicroErrorReporter micro_error_reporter;+  int i;+  error_reporter = &micro_error_reporter;+#if 1

Is this code needed anymore?

idog-ceva

comment created time in 2 months

Pull request review commenttensorflow/tensorflow

port TF Lite micro speech example to CEVA-DSP BX1

++

Can you add the standard TensorFlow copyright notice here? The file should also be formatted using clang-format -style=google

idog-ceva

comment created time in 2 months

Pull request review commenttensorflow/tensorflow

port TF Lite micro speech example to CEVA-DSP BX1

+++

I don't believe this file is used, it's legacy, instead the one in micro_features implements the fft now used in the example.

idog-ceva

comment created time in 2 months

Pull request review commenttensorflow/tensorflow

port TF Lite micro speech example to CEVA-DSP BX1

+++#include <stdio.h>+#include <stdlib.h>+#include <fstream>+#include <iostream>+#include "tensorflow/lite/micro/examples/micro_speech/audio_provider.h"+#include "tensorflow/lite/micro/examples/micro_speech/command_responder.h"+#include "tensorflow/lite/micro/examples/micro_speech/feature_provider.h"+#include "tensorflow/lite/micro/examples/micro_speech/micro_features/micro_model_settings.h"+#include "tensorflow/lite/micro/examples/micro_speech/recognize_commands.h"+#include "tensorflow/lite/schema/schema_generated.h"+#include "micro_interpreter.h"+#include "tensorflow/lite/micro/examples/micro_speech/micro_features/tiny_conv_micro_features_model_data.h"+#include "lite/version.h"+#include "micro_mutable_op_resolver.h"++constexpr int kNoOfSamples = 512;+bool g_is_audio_initialized = false;+constexpr int kAudioCaptureBufferSize = kAudioSampleFrequency * 0.5;+int16_t g_audio_capture_buffer[kAudioCaptureBufferSize];+int16_t g_audio_output_buffer[kMaxAudioSampleSize];+int32_t g_latest_audio_timestamp = 0;++int16_t audio[513];+int scores_count[4] = {0};++++char filename[50] = "input.wav";

Can you break the file loading code into something like examples/micro_speech/ceva_bluevox/audio_provider.cc ? That should help reduce the amount of duplicated code that's needed here.

idog-ceva

comment created time in 2 months

push eventpetewarden/c_hashmap

Pete Warden

commit sha 90541d1dd9e34393532d8ecb722a08730fbebfb6

Update README to include deprecation

view details

push time in 3 months

issue commenttensorflow/tensorflow

TFLu wrong predictions for optimized model

Thanks for the report, and sorry you're hitting problems!

This definitely seems like a bug, but the behavior that I would expect here is that the kernels would report an error because they don't support the combination of float calculations and eight-bit weights. This isn't well documented, but for code size reasons we focus on either pure eight-bit activations and weights, or float activations and weights, and don't support the "hybrid" combination of float activations and eight-bit weights in TFL Micro. This combination is supported in the mobile version of TFL, which is why it works in the Python interpreter, since that's using the mobile version.

We should report an error here rather than letting the calculations continue, we should figure out which kernel is failing silently and allowing uninitialized data to flow through the graph.

To solve your problem, can we help you figure out how to convert your graph to fully quantized weights and activations? Are you seeing accuracy issues with that approach right now?

lheim

comment created time in 3 months

pull request commenttensorflow/tensorflow

Add tests in TFLite micro for Float/Uint8/Int8 Tanh activation

@njeffrie could you take a look at this? Thanks!

giorgio-arenarm

comment created time in 3 months

more