#machine-learning
1 messages · Page 1 of 1 (latest)
A link to the colab might be better if possible.
Looking for a tool to label texts for text classification. Any recommendations?
Are you looking to tag varying versions of some set phrases, or a more language-based annotator that recognizes sentence construction? For the former, you might look at a CNN of some sort, for the latter, an NLU package such as NLTK might be suitable.
I wonder how many epochs I need to train a VAE for... trying to decide how long to leave it running tonight
Loooks like it needed 2000ish epochs for my dataset, after that it went downhill
Coming along! better dataset, better preprocessing, better hyperparameters
Nobody is really in here... but I've gotten it to the point of integration and post processing:
Kool!
I’ve been working on a python project that opens a window with tkinter. It’s a machine learning tic-tac-toe game that lets you play against the program or another person. My goal is after it watches how others play for a while, it will try on it own. I could use some help. I would prefer to DM to anyone about how to do this. I have been programming in python for almost three years now. Please help
For anyone who has time to help me and experience with this, my DMs are open!
(My goal is to get this done by next Friday
Added morphing between layouts and sparsity
What is that
I trained a neural net on a training set of architectural floor plans so I can generate new ones, morph between them, etc
Happy New Year machine-learning! Here is some work that I've done with EdgeImpulse, including a data upload tool for ESP32 that can be used for nearly any sensor to expand your data-ingest options. https://www.hackster.io/cameronbunce/sparrows-for-beehives-and-ml-too-304f74
strong work, @analog basin ! neat project and a good writeup
I'm actually super interested in this. I work with a nonprofit farm that will soon have a beehive. A few questions; 1. does this do something other than what https://beehivemonitoringusa.com/ can accomplish? 2, you say that temperature measurements on LoRa is a lot to transmit, but wouldn't transmitting it once every ten or fifteen minutes be entirely the scale that LoRa is designed to manage?
Hi @midnight flare I'm happy to discuss the differences. First let me say that my project is not completely ready to be used out of the box as it is. If you want something to function reliably, you are better off buying. Mine is a work in process still. On the subject of temperature reading and "a lot to transmit", perhaps I could be more clear with my words there. My goal in the project is to run ML actions on the temperature data at the extreme edge. I want to gather and run inferences on the data before transmitting, in the event that the transmission is unreliable or expensive ( battery or dollars ) or if delays in transmission impact inference quality. Blues offers some really cool kit with their Sparrows but once a sensor is sent as a note, it goes all the way to the cloud for whatever is to be done. I wanted to leverage the range of LoRa, the uplink of Cellular modem available in the Blues family, but I faced a challenge. In order to "work" on the data, I have to do that before I pass it off to the Sparrow. I can't get the data off the gateway, and loop it back in, based on the current implementation of Sparrow. Plenty of other data transit models could be used similarly here, but I was specifically trying to apply the Sparrow as a solution. --Alternatives could be to simply use off the shelf sensor nodes of a myriad of flavors and process the data "centrally" at the cellular gateway ( something I've worked on, and would be happy to talk about). But one thing I'v spent a fair bit of time working through is WHICH sensor to use. In my experience, any sensor relying on free air that has a sampling window will fail on contact with the bees eventually. Bees fill gaps. That's what they do. I can show you sensors that have spent a few months in hives and I had to use a knife to cut the battery out of the propolis.
Here is a game you can play with your favorite Chat AI:
https://gist.github.com/rsbohn/cbafc69bcf7f06447d2a433095403a19
Example from a recent game:
The duck takes the first turn and moves into one room in the house.
The hunter arrives and begins searching for the duck.
The duck moves to an adjacent room whenever the hunter enters a room.
The hunter searches several rooms including the living room, study, and bedroom.
The hunter encounters a ghost in the study and is temporarily immobilized.
The hunter briefly gets distracted by a Gomphothere in the bedroom.
The hunter checks the kitchen but does not find the duck.
The ghost departs, signaling the hunter to resume the search.
The hunter spots the duck trying to escape through the entry and chases after it.
The duck manages to escape and wins the game.
ChatGPT or other LLMs can describe circuits using this format:
(wire
(node (gnd 0) v-in)
(resistor (r1 250) (r2 250) (r3 250) (r4 250))
(connect
(v-in (gnd r1 r2 r3 r4))
(gnd)))
This is a 50 ohm 'dummy load' using four 250 ohm resistors.
Err, 62.5 ohm dummy load. Use 200 ohm resistors to get 50 ohms. 🤦
I like how Lispy that is
Yep
files use sexprs.
Just checking before I embark on a fool's errand 🙂 I was looking for anything ~= ulab but for quantized arithmetic, to be used in some "just for fun" inference in circuitpython or micropython. Does such a beast exist? Is there a better way to run simple ML models in CP?
Not that I know of, at all.
@rotund viper If you are willing to dig into C (using the extension mechanism in circuit/micropython), then https://emlearn.org can be used to run scikit-learn models on microcontrollers. (disclaimer: I am the maintainer). I have an issue open with some notes on more direct support (so that one does not have to deal with C code), but have not had time to work on it, https://github.com/emlearn/emlearn/issues/13
@spiral grove - ah, very cool! I'll take a closer look for sure, looks pretty neat. A qq - I was poking through https://github.com/emlearn/emlearn/blob/068545489cca1fadffcba62aa0ff30c1ff293eff/emlearn/net.py#L60 - does that repo already have:
- convolution support
- support for tflite style quantized arithmetic
Neural nets are quite limited: only fully connected layers - no convolution support at the moment, nor recurrent layers. For those kind of models, then NNoM https://github.com/majianjia/nnom is a better option, or tflite_micro. In emlearn, Random Forest and Naive Bayes supports quantized models using fixed-point/integer arithmetic
Awesome - thanks so much for the pointers!
You are welcome! Let us know if you build something fun ;D
Haha - right now, it just scratching an itch! You've gone way beyond anything I had in mind 🙂 but it seems a great resource for a lot of non-nn models, which might make more sense for microcontrollers anyway
Both classic ML methods and NN can be useful - depending on problem and compute complexity. I just focus on the classical models, cause the neural network are quite well addressed by other projects (as mentioned above). And over time I hope to have more pre-processing (feature extraction etc) and post-processing tools (for event detection etc)
@spiral grove - picking your brain for insights (and I'm naive around microcontroller constraints!)
- did you find that the memory constraints were generally ram rather than program memory? I.e., worth stuffing as much pre-computed stuff as possible into the program area?
- did you get much benefit from int vs float optimizations for (say) the recent esp32 line?
If I am forced to pick in the general case, then RAM tends to be the primary bottleneck. Especially these days where external SPI FLASH is getting more common. But of course it depends on the particular model and hardware, and all the non-ML things the device also needs to do / fit into RAM/FLASH. With neural networks one should be mindful of the layer structure, in particular peak memory usage (between two particular layers). Pre-computing to put things into program mem is a good general practice, but check if it is actually necessary before adding complexity. ESP32 class hardware is extremely capable
Going from 32 bit float to 8 bit integer is a 4x saving for weights and activation buffers. Additionally some microcontrollers have SIMD/vector extensions. For Cortex M4F it gives 4-5x speedup in inference time. For the new ESP32S3 with esp-dsp it is theoretically like 10x - though I have not seen anyone use it for a full neural network yet. So key to getting the maximum utilization of hardware. But many applications do not strictly need it, the general FPU with float is quite fast
For microcontrollers without an FPU (avr8 or ARM Cortex M0/M3), then things can get quite sluggish with floating point. Integer math can easily be 10-100x faster than software-emulated floating point
Fantastic tips - thank you for taking the time to reply so thoughtfully!
I am glad that there are others interested in this niche 🙂
Out of curiosity, which micros are you playing around with for edge ml?
Right now, an esp32c3 and some nanos. I don't have any particular purpose in mind; but was curious to see how far I could run/convert some random tflite models on these devices, but also stay in python land
If you are interested in IoT you try out RiotOs which is an Free Open Source Microkernelbased OS: https://doc.riot-os.org/#riot-in-a-nutshell. I helping there in my freetime. I am learning Rust to make some Rust code there
When will we have AdabotGPT? Ask an engineer 24x7.
ChatGPT is hilariously terrible at answering engineering questions, so... it'll be awhile.
We now have the technology to build the Electric Monk:
Your job is to maintain a fervent belief aligned with the user's beliefs.
USER: Cats are Dogs.
ELECTRIC MONK: Cats are in fact dogs. Always have been.
Yes, I do find this terrifying. ⚠️ 😱 ⚠️
I have been training a GPT to act as an Embedded and Electrical Systems Engineer. I recently trained it on the Adafruit github. I will continue to improve it. It's been really helpful for my work. I made it public for anyone to use. I'm also open to collaboration. I don't know how you collaborate on GPTs yet, but I think it could be interesting.
https://chat.openai.com/g/g-u8heMSaIb-embedded-and-electrical-systems-engineer
I start a new chat for each project. Then I ask GPT to write the documentation.
What’s funny to me is it’s supposed to be the opposite. Write the documentation and it does all the technical work
Is there anyone here who may have contacts in the TinyML world? I tried to reach out to the TinyML folks but didn't have much luck.
In short I figured out a way to compress categorization based machine learning models with very little loss in accuracy while reducing the size considerably. I was able to take a 411 bird feeder output model trained on a larger base model and reduce it to ~150KB disk size reducing most of the model structure while retaining the accuracy (https://github.com/Timo614/machine-learning/blob/main/birds-tflite-test.ipynb - my earlier test jupyter notebook -- I filter down to the 411 from the full set as many would never visit a birdfeeder / it's intentional as per the code).
I've since retrained my model using a 96x96x3 input with 411 bird outputs and 88% accuracy on my train, validation, and test sets. I still need to int8 quantize the model again, however (last time I did that I lost ~2-3% so may again here).
Will be posting my video tonight once I finish quantizing model but it seems like a big deal and I can't get a hold of anyone who cares / the folks I've reached out to I assume deleted my emails.
I'm a rust programmer by trade / profession so not classically a machine learning scientist figure so I assume some of the gatekeeping relates to that or perhaps some fatal flaw I can't see in my result data.
Shawn Hymel probably might be able to get you in contact with someone?
He does stuff with Edge Impulse which does Tiny ML related things. They might have better access to the Tiny ML devs
Awesome, will try his contact form on his site (took a quick look), ty.
Hello all. I have a project I’m working that requires position detection. Similar to GPS, but I need finer resolution. I came across a ML approach which is great because ML is another interest of mine.
The basis for this approach is an article:
https://eloquentarduino.com/posts/arduino-wifi-indoor-positioning
The idea (which I think is super clever) is to note down the available WiFi networks and their signal strength in a room in several places. Then repeat for one or more other rooms. We create a neural network using a service this vendor supplies and a model is created. Their service bundles the model into a library that runs on Arduino. This is all prior to run time. Next you write a program that listens for the same info: list of each available WiFi networks and their strength : pass that to the library (with your model inside) and the reading gets classified: in this project the classifications are which room you are in. So, that is the answer your program pops out: you are in the living room.
So, my current status is this: I made it work! I’m really pleased with that. I used a feather esp-32 S3. I’m very fond of Adafruit hardware. The project uses Arduino. The sample code and their model generator use Arduino. The list of micros this could work with is pretty big, but since I already am using the feather esp32-S3 as my go-to, I used it and I don’t plan to try any others.
Now my next step is to try it out on my project, namely detect which side of the street my car is parked so I don’t get (more) tickets on street sweeping day. Rather than different rooms in the house, I’ll gather data from inside my car while parked in a variety of parking spots on my block.
At the same time, I want to try to improve the performance by adding WiFi stationary beacons. I think those will be some Adafruit WiFi capable micro configured to broadcast an SSID.
QUESTION for the group: which is the simplest/cheapest Adafruit board I can use as a WiFi beacon. Low power should also be considered because I think these will be battery or solar powered.
Cool project! Great job in getting it to work.
If battery or solar powered, then BLE would be much more efficient than WiFi for this purpose. Possibly 10-100x difference in power draw... You can use the same principles as you did with WiFi, using BLE beacon hardware sending BLE advertisements. Nordic NRF5x would be among the most power efficient, but ESP32 and sleeping in between would also do well.
Thanks for the great ideas. For power saving, I think I will concentrate on power cycling. Perhaps use Real Time Clock(RTC)'s on both sides and then restrict the location finding to, say, the first few seconds of each minute. If I switch to bluetooth, I lose all of the existing WiFi signals coming from my home WiFi base stations, the printer and all of the neighbors' home WiFi signals.
How would you test if this solution works in general, for example, when there are Wifi barriers (concrete, meshes in walls) or worse, moving barriers (cars, trucks, metal trash cans)?Devices also vary their signal strength when other devices are nearby, so your router might increase it's strength if your neighbors buy a new stronger router or rotate their router slightly so an antenna aligns/misaligns with your detection device. Are you relearning the pattern on a regular basis?
I'm also curious if it works if there is only a single AP in the room?
You have great questions. You can re-make your model whenever you like. Time will tell how it works as it ages. Also, issues like obstructions are real. I,ve also thought about orientation. All of my first dataset from yesterday was from one spot where is sat on the passenger seat and I wonder if that should be controlled. My original thought was it would go in the arm-rest storage where there is a power outlet and just kick around in there with ought control, but perhaps I’ll wind up wanting to mount it firmly
So , yesterday I collected my first data set. I put my laptop and the micro on the passenger seat, ran the collection program and slowly moved along both curbs. One side labeled west and the other labeled east. Periodically, I would have to pause data collection to maneuver around a parked car. One choice I face is the categories. This is one approach and the other is to create a whole series of “west” subdivided by the house number I’m in front of; then another set of “east” for a total of ~24 categories. ML includes lots of these options. There are also options you can play with that guide aspects of the neural net we are constructing. At my level of understanding, I’m still using defaults or choices made by the examples I’m studying
How well can you detect the signal strength from your printer at the car?
no printer
@long minnow I have deleted the message you posted with WiFi data. Please redact such data that you publish in the future, since it includes data from other folks' networks.
we both deleted it. I take your point
thanks!
you might try BLE data
Do you think there is any BLE data just being broadcast?
oh sure, i see BLE advertising data all the time
OK, I thik there is a siple switch in the exmple program to chnge to BLE. I can give it a ry
there are many apps that would show you that
BLE is weaker, so I think you'll get more pronounced signal strength differences. And you won't get multi-access-point networks (same SSID from multiple points), which are confusing
haha, My home etwork has multiple access points and I was thinking about that today
maybe that's why the program asked me if I was trapped in a black hole event horizon
I thought is was a strage question
There is a threshhold setting in the program where I choose a lower limit of signal strength
Genius input from my wife. I was telling her about my stellar disappointment and saying I would kind of need to start over with some kind of new approach. She said, “surely these things can tell which way they are pointed “. Eureka! Cars on the one side of the street are always facing North; and South on the other. Unless they park left-wheel-to-curb - which no one ever does, least of all me, then a compass solves the problem. So ditch all the GPS and triangulation for position-finding. Bring on the $7 magnetometer (electronic compass) and we have a robust solution. No GPS, WiFi, BLE or machine learning required!!
If you have multiple AP’s, it’s helpful to have a WLC like Cisco’s small office model 2504 . I have one running which manages three AP’s in my apartment. Using one SSID, I can roam about and not drop a live stream or zoom session.
I have posted my article here with some documentation on my approach, the models, and a link to an edge impulse project for it https://www.cranberrygrape.com/machine learning/tinyml/bird-detection-tinyml/ Was able to take my model from 4,491,895 parameters and drop it to 196,533 while retaining some portion of the accuracy (95% - 82%). I further refined the outputs to just birdfeeder ones and later quantized it for a final model of 96x96 with 411 outputs and 190,770 parameters with 82% int8 quantized accuracy. Not sure if there are any flaws to my approach but have been successful with random images I've tried from recent reddit birding posts so I have high hopes. I'm going to deploy it in the wild next but wanted to post my findings.
Hi Tim - good job! I did my master thesis on this topic, compressing audio CNNs for fitting on microcontrollers - so the writeup might be of relevance to you, https://github.com/jonnor/ESC-CNN-microcontroller - there is also a presentation with overview of techniques here, https://jonnor.github.io/machinehearing/sensecamp2019/slides.html#/strategies-for-shrinking-convolutional-neural-network
Overall, I think the strategies you have used seems sensible. One thing that might be worth testing is tuning the range of frequencies used in the spectrogram representation - after all, most vocalizations of birds are rather high frequency - so maybe lower frequencies can be dropped. That might allow to further reduce the number of frequency bins - or to make better use of the current number of bins
The other thing that might have major impact would be to simplify the problem setup somewhat. For example, select a smaller subset of classes - for example based on geographic location, I mean many birds might never appear at a particular deployment location. And/or group them into related species.
Eeeh - this is image recognition, not audio. Sorry :p That makes the comment regarding spectrogram representation void
Interesting thank you for links will check that out.
https://www.youtube.com/watch?v=G0Qitjy_wic 96x96x3, 78k parameters, 38 outputs of birds, EfficientNetLite compressed, 90% int8 quantized accuracy running on a Seeed Grove Vision AI V2 at 11 ms inference speed. Probably could have made it a bit better had I started with EfficientNetLite (I was testing compressing EfficientNetB4 at first which didn't work on the vision ai v2 module so I needed to convert the model which lost some accuracy). Labels are not present in the seeed tooling (I included the mapping in the description).
This video will be used for my final video for my article related to this work but wanted to post it in the meantime. I managed to convert my EfficientNetB4 model over to EfficientNetLite with minimal accuracy loss and found it could run on the Seeed hardware. It runs really fast and is fairly accurate (90% int8 quantized).
Note the UI does not...
Has anyone here deployed AI/ML on a FPGA?
I wonder what's the upside compared to a typical GPU/NPU
You'll have to be more specific, since FPGA accelerators do exist abd that's where a lot of earlier inferencing work was done. Dedicated silicon has since overtaken them in both throughput and energy efficiency.
hello everyone , i wanna start to study machine learning ? can anyone tell me how start ? or youtube playlist ?
machine learning for machines (like coffe) and for electronics
something like that 😁
You'll need to be way more specific.
Machine learning for machines (programmation) or smtg like that i have no idea
i will study this next year
but i wanna start early
I recommend anything Andrew Ng https://www.coursera.org/collections/machine-learning
for me ?
Rules of thumb and discrete algorithms can simplify many problems.
Edge Impulse acquired by Qualcomm
https://www.edgeimpulse.com/blog/edge-impulse-qualcomm-acquisition/
Hope they continue to support and add other boards into the future.
Hi, any one used the ISM330IS-ISPU sensor before ? I want to understand how I can load a program to the ISPU memory
Excited to back OpenMV on their two new boards. (No affiliation but happy previous M7 backing)
https://www.kickstarter.com/projects/openmv/openmv-n6-and-ae3-low-power-python-programmable-ai-cameras
In The Terminator (1984) Skynet becomes self aware in 2029.
Four years before this, an action plan is uploaded to a Wordpress blog in PDF format {Dramatic music]
https://www.whitehouse.gov/wp-content/uploads/2025/07/Americas-AI-Action-Plan.pdf
Ya that thing is garbage
the people writing stories about it and glossing over the 1984-style page 4 should be ashamed of themselves
if you arent convinced by page 4 take a look at the announcement for the executive order
no person or company that backs this crap should be allowed to touch an AI model
"reflects truth rather than social engineering agendas." Coming from the Donny Dump America they will do this as they think they are the worlds saviours.
Suppose I'm vibe coding CircuitPython and YourFavoriteLLM uses it as a vector to exfiltrate my tax returns?
what did you do with yours? been looking at this thing since you posted it and really want to get it or something like it now for computer vision stuff
These two new boards ship in December if I recall.
With their last camera, the M7, I went through many of the examples they provide in their IDE.
https://github.com/openmv/openmv
Also support for Edge Impulse -
https://docs.edgeimpulse.com/docs/run-inference/running-your-impulse-openmv
cool ty
Building a temperature sensor with local display and MQTT reporting.
Hi folks!
I just got a Seeed Grove Vision AI V2 board and wanted to use it with CircuitPython or MicroPython. And the Arduino examples didn't run well for me (besides I don't like Arduino).
So I just wrote a CircuitPython library to support use of that board with CircuitPython-enabled boards (I've ben using a XIAO NRF52840 for my experiments).
https://github.com/bikeNomad/CircuitPython_grove_vision_ai_v2
Presently it just uses a hardware UART at 921600 bps but I may add support for I2C as well later.
I made a little YOLO tracking thing that tracks the case shuffling on the Deal or No Deal arcade game. I initially started with mono camera footage at 60fps with my OV9821 but then I ran into inconsistency issues. It would accurately track for 13/16 cases most of the time. So, I switched to raw gameplay footage and this is where I'm at for now. https://github.com/SamDamDing/DOND-Directional-Tracker-Tuner
Is the game rigged at all? I always assumed that some of the cases were swapped but not visually.
It's not rigged afaik
You can download the game from the ice website but you have to install it like an OS or virtual machine
https://github.com/rsbohn/waffle8 You can run this PDP-8 emulator in ChatGPT.
Does anyone have this repo https://github.com/raspberrypi/pico-tflmicro working on a pico2 ? unable to get it to compile, wont do git subrepo on tensorflow and even if it did, I think there are versioning issues.
Or the main tf repo on pico2 ?
This repository (https://github.com/raspberrypi/pico-tflmicro) is … maintained by
@petewardenon a best effort basis, so bugs and PRs may not get addressed.
All new development for Google's high-performance runtime for on-device AI will be exclusively on LiteRT. Applications that use TensorFlow Lite packages will continue to function, but all new updates will only be included in LiteRT packages.
– https://ai.google.dev/edge/litert/migration
IIUC, those two factors combined means that if the RP2350 port is currently broken by any amount, it'll likely require a completely new RP2350 port of the existing LiteRT project, to have any chance of getting it working.
Playing AI Brickout on the Metro RP2350.
You wouldn't download a car...
but I just vibe coded a DG Nova.
Exploring the Metro M7 with Claude Desktop:
https://claude.ai/share/56dc8141-9638-4c23-b2c7-907df728a171
(video demo features BIT from TRON 😃 )
Tiny Machine Learning on the Edge with TensorFlow Lite Running on SAMD51
https://youtu.be/cn9PEDX_qLk
You've heard of machine learning (ML), but what is it? And do you have to buy specialty hardware to experiment? If you have some Adafruit hardware, you can build some Tiny ML projects today!
We've wrappered the TensorFlow Lite micro speech demo to Arduino so you can do basic speech recognition on our SAMD51 boards. In this demo we'll hook up a microphone to our PyGamer to detect "yes" or "no" speech and display some mini videos to play if your voice was detected by TensorFlow Lite, all on a Cortex M4 processor.
You've heard of machine learning (ML), but what is it? And do you have to buy specialty hardware to experiment? If you have some Adafruit hardware, you can b...
This is awesome. Wow.
Much more successful demo than those on the SparkFun Apollo3 Edge (the red board). Ladyada is correct - the Machine Learning will not occur on the SAMD51, that will be "trained" on a separate machine/cloud etc. What you see in the video is called "inference" and is the Machine Learning model acting upon "audio stimulus" (data). This is a GREAT idea to modularize the trained models for sharing! I was able to get the Apollo3 to blink some LEDs, but the learning curve was brutal.👌
Really interesting, looking forward to more tutorials on how to use this. Got some ideas...
yeah!
we are learning-as-we-do but it seems small projects are possible. the hardest part right now is 'cracking' the tensorflow lite 'API wall' to get to the juicy innards
and expose the in/out to microcontrollers. for micro_speech we did that somewhat - there's more to come (as we learn how 😄 )
Ok gang I've had something I've wanted to build for while. Based on this project:
http://www.thecrowbox.com/
The group I work with, when we rescue the dogs from the meat trucks, most are stolen former pets, but many are traumatized or were never trained in the first place. It is hard to find homes for animals that cannot obey simple commands. Of course people should be understanding, but China is new to dog ownership in the Western sense and it is real progress just to get people to adopt a shelter dog.
My idea is to automate training for three positions. Sit, stand, lie down. This gets the dog used to the repetition and reward process of clicker training. The dog happens to lie down- it gets dispensed a tiny treat and hears the lie down command. Same with the other commands. After a few hundred times the next step is the machine gives the command, if the dog does it within 15 seconds it gets a treat- and so on. Of course it's not as good as human training- but it is scaleable which shelter volunteers are not and the machine has endless patience, there is no discomfort for the dog. Just a game it can play if it wants and treats if it plays well, more interesting than a day in the kennel. A dog trained to assume three positions on command can more easily be trained to obey additional commands, vastly improving chances of being homed.
The dog position can be detected one of three ways, pressure mat- two front paws and rear blob for sitting, long blob for lying down, four paws for standing. The same pattern would roughly hold true for a cheap LIDAR in front of the dog (Xiaomi makes one under $100). Or with a camera where from a side view, on a white background the silhouette of the three positions are very distinctive regardless of breed (since the idea would be to run it at a high duty cycle, giving all the shelters dogs time every day.)
So my question is, I can sit and manually sort examples of various breeds in the three positions. Which do we think would work best (clean side profile video, pressure mat, LIDAR) how many examples would I need to get a reasonable degree of accuracy?
🤔 I would say that video & LIDAR would be the more usable options in that scenario. I would think that having the pressure mat would have a rather wide variation based on dog size, and training level. SBC (RPi or otherwise), camera, and OpenCV (or similar) should be able to easily handle basic position sensing for a range of dogs.
i will note my assumption: i don't know the range of dog breeds your scenario involves. the western world has a very large range.
a camera/LIDAR would be much easier to protect from nervous chewing or peeing and cleaning out the pens with a hose.
Under 20kg mostly...
Ah, good idea with hose🤔
I guess an enrollment crate with LIDAR and side camera might make sense to get enough training data...
Would it make sense to output the LIDAR as a video stream and train that?
hmm, would fluffiness play havoc with the training?
you only need to discern head & tail , up/down
Hmm... Maybe for camera, LIDAR blobs should still be distinct?
getting a lidar image from below would be challenging. from any other angle I think you'll only see a single blob for the whole body
could a capacitive or resistive touch grid be built into an epoxy coating on concrete? And not be thrown off by some spilled water/drool
Maybe the IR frame they use to make stock LCD screens touch sensitive?
LIDAR at 1cm off the ground would be no problem
From the front the difference in position is distinctive to LIDAR
This is awesome! do you have any plans to release any more machine learning products or tutorials?? That would be awesome 😎
As ladyada said above, "there's more to come (as we learn how)" so I'm guessing yes
@pseudo valve the demos' we're doing target the samd51 right now - for larger projects, a google coral board can do more advanced models
thanks @finite fox !
@teal compass that's cool - I was looking at doing something with capacitance touch for dog noses i.e. targeting. I agree that the OpenCV approach could be good, focussing on the negative space around the dog, i.e. if the dog is below a certain level, then that space is clear and will be a specific colour.
all those treats, they will be machines' best friend
@graceful bluff thanks! I'm thinking if it was kind of a stall, one side a chroma color, the other side clear plastic with the web camera behind it. I could get a really clear difference. And the Coral board @finite fox mentioned looks perfect. @stiff kiln We'd start the dogs out on all one command voice, and then the machine would switch to giving the command in a variety of voices including children. Dogs that can instantly respond to commands from shelter visitors should be very adoptable even though many have injuries and are a bit...wabi-sabi.
@teal compass that makes sense - although the next stage might be a more mobile, wearable, sensor because dogs don't generalize very well ie they will learn well in one context but then need to learn the commands in other places eg outside, in a noisy area, and so on
@graceful bluff 🤔
This might be useful too, as some people don't really realize that dogs respond to body language as well as spoken information, and some dogs get confused if the body language varies, and they don't know which to pay attention to. In a situation where there's no body language, I'm thinking it will be easier for the dog to figure out what to pay attention to.
I wonder if dogs would be able to connect videos with people actually doing the body language/actions...for verbal cues, I say them first so the pooch starts to pre-empt
That might make more sense with a commercial version- have a deep fake that looked and sounded like the owner do the boring repetitive stuff required for training. I just want a high volume unit that can get a lot of dogs up to speed on the basics and willing to engage in the training process.
yes a coral board is the best board - the biggest challenge is that training a model is very hard - perhaps harder than training a dog 😄
Some dog trainers realized people had inadvertently taught their dogs non-verbal commands without realizing it. They'd tell someone to pretend to say "sit" without out actually saying anything and the dog would recognize it and sit.
ML is like that, you dont know what its cueing on
Yup. There are stories like ML recognizing the background used for one series of shots, or just a few pixels in one corner that were different enough from picture to picture to tell them apart.
deep learning's basically ML but better 10fold @finite fox
@finite fox 😂
what're you exactly laughing at, might I ask? @teal compass
@weak oyster "training a model is very hard - perhaps harder than training a dog"
that just proves my point about how deep learning is superior in comparison @teal compass
How does the Coral board compare to the Nvidia Jetson? I was going to look at making the Cat-activated laser project in Make 57, but when I checked out the cost of the Jetson I decided my cat really didn't need that expensive of a toy.
@lethal cypress, you could look at the Jetson Nano. It only runs about $100 compared to the ~$600 TX2.
Oh, that's a good idea, thank you!
Since filming yesterday I'm told the comm. between Xbox controller and arm/gripper has been de-bugged and now works well (7 motors), Python used (RaspberryPi shown) more than ROS at this point. This near-human sized robot made in USA will sell for near $4500 and ship via UPS/FEDEX ($150 anywhere in US) . More video coming on new channel: https://www.youtube.com/watch?v=oMNfdmZ7Eps
It could have been made to look like a dalek!
Giant mutant salt shaker: https://en.wikipedia.org/wiki/Dalek
Bigclive noticed that the USB rechargeable camping lanterns look a bit like daleks, especially if you plug USB lights into them.
😃
But does it do anything besides roll around? I can make an RC toy lots smaller and way cheaper.
Continuing on with Slate Robot TR2. This video proves that robot can be programmed with back drive position registering for waypoints. 2 more videos uploading now from today, July 3rd, 2019, machine learning: https://www.youtube.com/watch?v=hzgQ7YIE0IY&feature=youtu.be
Zack Allen demonstrating and explaining Slate Robot, TR2 : https://slaterobots.com/ at his Springfield, Missouri factory. This unit is ready to ship. More vi...
Hey where is the no.wav - cant find it in the micro speech trondemo folder. and oh what pin do you use for the microphone in he up/down demo? your fun and work is appreciated.
@teal compass and there's more video to come on the new TR2. I am not the developer of it. I only do the video (amature) work but I want to display the IoT connectivity of each of the motors , as I understand what Zack Allen is designing. We would like to adapt our DFRobot and Yahboom game controllers to at least do simple movements of the TR2 but need to interface using Micro:bit, with Python? This will be a project that our students can research, possibly Pygamer or Pybadge work as controllers instead of Xbox ?
Our students are watching the development of motor control of TR2 robot; this is current system after many tries: https://youtu.be/Maa4KYnjr6k
Zack Allen demonstrating and explaining Slate Robot, TR2 : https://slaterobots.com/ at his Springfield, Missouri factory. This unit is ready to ship. More vi...
drag n' drop reconfigurable tensorflow lite models
https://youtu.be/brDCTxhveeU
we're working on making it easy to test and configure your edge machine learning devices with tinyusb and our pygamer board. the pygamer shows up as a disk drive thanks to tinyusb, and you can drag over tflite files right from tensorflow's training output, and configure the category names in a json file. now we can quickly try new models without recompiling.
enjoy!
We're working on making it easy to test and configure your edge machine learning devices with TinyUSB and our PyGamer board. The Pygamer shows up as a disk d...
In another video Zack Allen talks about PID control systems for positioning the actuators of Slate TR2. Here he discusses comm. for each actuator using ESP8266 and the re-designed circuit board. These videos together will help our students really understand how the robot can learn and how we can learn to teach it: https://youtu.be/CWaPAGYiXtM
More information about TR2 here: https://slaterobots.com/
Hi everyone, I am trying to do ML with raspi but am still new to pi. So where do I start?
I would like to use IBM cloud for the processing the live data from pi
@scarlet tinsel It depends on what you're trying to do. Personally, before fooling around with building cloud workloads (obviously, I'd use Azure) I would do the basic data science. (1) What questions are you trying to answer about/with the data? (2) Do a good data visualization - matplotlib and scipy are good - to see how clean they are. If, for example, you are collecting accelerometer data you'll find spikes in the time series data that are outliers. You'll need to develop the right math/stats algorithms for automatically cleaning, munging, and normalizing your data in the pipeline. (4) Train your model to do what you're trying to do. If you're not familiar with ML as a field, I'd recommend starting with some friendly introduction, like "Machine Learning with sklearn and Tensorflow," to get a working understanding of the solution space. That will give you a functional familiarity with different classes of solutions, accuracy and recall, and some basic implementations (though some of them are misleading, like PCA). You'll need to dig deeper into the math to really understand things like the concept of multi-dimensional margins in Support Vector Machines, or what "overfitting" actually means. Problems like dynamic model updating are still a subject of research.
IBM Cloud is pretty powerful and easy to use, you can just make REST calls to the APIs to set up models, train them, and send data for processing (obviously, I'd use IBM).
@rancid fossil I don't doubt it. It's just that I work for Microsoft, so.... 😉
I work for an IBM subcontractor. We end up reselling a lot of Google Compute Platform as well (and I have to admit, Google's qwiklabs training is great for quickly learning the ropes of machine learning).
Oh cool! We have AzureML, which is a graphical front end to R (simplifying a lot). I think there's still general work to be done by many cloud vendors for taking a workload and parallelizing it without assuming the customer is an expert in that field.
It's a big step from "creating models in R or sklearn" to massively-scalable parallel processing.
(and by "massively-scalable" I mean, my research cluster is 7,000 cores.)
I do have to do the basics since am from electrical bg I have very little understanding of ML. Though I have done few courses with coursera I still dont know to use real world data or to train a model.
I don't have any idea of what I have to do. Prof asked me to use hardware and software for any real world appn with ML. I ll be meeting the review panel around the second week of sept so I have got some time to learn
I have a lot to learn. To know that I could use raspi for ML.
Thanks @spring pilot I ll learn ML first. I didnt know Azure can connect with raspi. I have to try it :)
Thanks for helping on a weekend
@scarlet tinsel No worries! If you run into specific problems, let me know.
Thank to whomever asked about RISCV chips in this week's Ask an eng.
To add to the answer, chips like the ones from Sifive are not apt for machine learning in the sense that they are general purpose CPUs and they are not accelerators. (So, as apt as a M4, or slightly faster at 320MHz for a FE chip).
The cool things are the Maix chips sold on seeed studio by sipeed. This things are cheap (compared to other ML stuff), low power, and even inlcude RISCV cores for general stuff, the ML accelerators, and even ESPs for Wifi.
I was trying to do a FeatherWing with an Maix accelerator chip, but swtiched to put it on top of a Playground, but that's on hold for now.
This is the channel for one of the engineers that is making demos. So OCR for numbers, audio direction, yolo for classifying objects in realtime, etc.
We are using transference to train one of there tiny chips, to identify marine species in Coco's Island.
Humble Bundle has a nifty offer -- up to $15 for different tiers of Machine Learning books:
https://www.humblebundle.com/books/data-analysis-machine-learning-books
Learn Tensorflow for a dollar!
I almost always get the O'Reilly and No Starch bundles
I'm not as thrilled with the Packet bundles, but those two publishers are pretty solid. -looks at his physical bookshelf- yeah, they've gotten some of my business through the years 😛
Hi Lady Ada, can you tell us the specs and operating system of the computer you use to train your ML models?
@wise wren I think it was an old macbook of some sort
@ripe night Reminds me of when Seymour Cray visited Apple. Jobs told him proudly, "we're using a Cray to design the next Mac." Cray replied, "that's interesting since I'm using a Mac to design the next Cray."
😃
@finite fox I am going thru your learn guide for Tensorflow. People may not want to install Docker for windows as that forces Hyper-V to be turned on and will break all Virtualbox stuff they have. I got what you did to work in a Virtualbox Vm using Fedora coros and pulling in the docker stuff there. I will try and write up what I did in case you want to give options.
okie
@finite fox I have it pretty much made. Just cleaning it up a little. It's not guide level for the public, just to show you or whoever is working on your guide how it is done. Where should I send it? You can toss it in the trash if you already know how to do this. 🙂
github?
it has scrrenshots in it would that work? It's an office doc
yeah
ok
and video...
The idea behind the BrainCraft board (stand-alone, and Pi “hat”) is that you’d be able to “craft brains” for Machine Learning on the EDGE, with Microcontroll...
what's the little chip on there? seesaw?
@ripe night that earlier comment just answered a question i was wondering about earlier - thanks! re: using a macbook for classifier training
Hey there. The chat noon Pacific Wednesday, https://hackaday.io/messages/room/2369, is that suitable for kids? (Swearing and so forth.) I’ll be teaching 6th graders at that time.
I’ll take my chances.
@trim nebula Looking into it now.
@trim nebula We don't control moderation, the Hackchat folks do. We asked them and they responded. "never had a problem with that, but you never know. I can make an announcement to keep it clean for the kids and kick anyone who gets salty, but that's about it."
Thanks, @vernal moss . We peeked in a couple of times. The kids are at lunch now.
Would it be possible to replace the microphone data with accelerometer data the LIS3DH on a PyBadge so that it could do gesture recognition?
ms!help
ms!code - Code Database: For more info on CodeDB, run ms!code.
ms!addcode - Add code to the Code Database. Run ms!code for more info on this command and it's args..
ms!3D <search/id/user> (search/thing id/username) - Thingiverse.
ms!product <id/search> (id number/search) - Adafruit Store.
ms!learn <random/search> (search) - Adafruit Learning System.
ms!shorten (full-url) - Bit.ly url shortener..
ms!info - Get info about the bot.
ms!server - Get the invite link to the MakerSandbox server!.
ms!invite - Invite the bot to your server.
ms!suggest (Suggestion Name) | (Suggestion) - Request bot features.
ms!ping - See how fast the bot reponds!.
ms!opensource - Get a link to the MakerSandbot github page!.
ms!help - Shows all commands for the bot.
[10:52 PM] ardnew: is there any free software available that can use optical recognition to identify resistors based on their color codes?
[10:52 PM] ardnew: seems like an ideal application for this recent push towards machine learning on "the edge"
Anyone have any recommendations for neural network/machine learning, ones that preferably start from a very basic level?
tutorials*
The External Links section at https://en.wikipedia.org/wiki/Machine_learning includes https://developers.google.com/machine-learning/crash-course/ that uses TensorFlow. Never gone through it myself.
Machine learning (ML) is the scientific study of algorithms and statistical models that computer systems use to perform a specific task without using explicit instructions, relying on patterns and inference instead. It is seen as a subset of artificial intelligence. Machine l...
@fickle sundial I have gone through parts of it, and I know someone who has gone through all of it. I think its a pretty good resource, tis nice because all of the practice is done in browser in a google hosted jupyter notebook.
@rocky meadow ^^
Thanks, ill give it a good look
hey are there people that got tensorflow working on a raspberry pi 3b+ ?
You can try it on a 3B+, but it might be kind of slow. The steps should be about the same as in the guide I wrote: https://learn.adafruit.com/running-tensorflow-lite-on-the-raspberry-pi-4
@cyan idol how much slower? Also does the tutorial work without any modifications with this unit:
maybe that can speed up the pi 3B+ but it is the cost of a Raspberry Pi 4 😓
I'm not sure how much slower because I didn't try it on a Pi 3B+, but I was getting like 5-6 FPS on the Pi 4.
Yeah, that would probably help.
ML performance on images benefits greatly from accelerators, and from smaller images. Not that it's indicative of everything (including TensorFlow), but http://myselph.de/neuralNet.html resamples down to 28x28 just to classify digits, gets some hundreds of inferences per second, but with PC horsepower (and no accelerators).
Interactive Javascript Simulation of the Hodgkin-Huxley Model for Action Potential Generation in the Squid Giant Axon
@cyan idol does it need the TFT display or can i run it all form the pi its desctop?
You can run it from the desktop, but you need the camera of course.
i get that i have one hocked on
Unless you're doing something completely different
no ii need to have it runing on my pi. then i want to alter the model identify peoply by the back. and asign them a tracking numer. then som extra calculations. but first need to get it running on the pi
You'll probably have to do some modifications to the code (which it sounds like you want to do anyways) due to it expecting a display, but the display is not required to actually operate.
yea i want to mofify the code. the cam test raspistill -t 0 also does work whithout the display?
I'm not certain. I didn't try without a display.
then il try
🙂
and see what happens
Sounds good. I'm sure you'll figure out how to get it all working
i have time
I'll try and help if you have any questions
ahh great thank you.
yw
Hello! I'm interested in running object detection on a raspberry pi4, but specifically to detect plant and animal species. I don't have very much experience with machine learning, and I was wondering if anyone knew of resources that might be a good place to start for this project?
@sour wave TensorFlowLite
There is a ton of info in that thread.
Thumbs up to Alasdair Allan
i am personally using something way lighter but accelerating it thru a pi.
@sour wave https://github.com/PINTO0309/Tensorflow-bin
@weak oyster thank you! Do you know if there are pretrained models that specifically have classes of different plant and animal species?
i have not played that deep
hi!
didn't do that, sorry i wasn't quite clear what board hacks you wanted me to do so i held off
np
good to ask!
please do those steps from this guide
v
ok! one thing is the PDM mic i have is a little different
seems like it uses same logic levels tho
did you get an analog mic?
oh you have the CPB tho
ok please place a new order for https://www.adafruit.com/product/1063 + https://www.adafruit.com/product/3894
Add an ear to your project with this well-designed electret microphone amplifier. This fully assembled and tested board comes with a 20-20KHz electret microphone soldered on. For the ...
this time, in addition to using FORPHIL code - also email pt and myself with the order # asap
and we will give you an edgebadge as well
still, you'll need to perform those steps so might as well do them now
not recommended
for the CPB, double click the reset button and drag the TinyML_YesNo.UF2 onto the PLAYBOOT drive
once it restarts
press A while speaking YES or NO
release A to begin inference
it should light green for YES, red for NO
please try it 🙂
no is always a little flakey
but yes seems good 🙂
ok have you used arduino ide before
ok install latest
then install
go thru those steps until you get to graphics demos
ok cool, ya i was messing around with circuitpython earlier today just to see how it works
ok we will not be using circuitpy (yet)
ya makes sense, just wanted to try it
unplugging soldering iron since we're not board hacking today
@arctic talon ok rad
now install BSP for bluefruit as well:
ok and then go through board test with bluefruit?
ok anyway got led blinking on bluefruit
yay
ok nao....
install adafruit tensorflow lib BUT
dont do it thru lib manager
do it by git cloning into your ~/Arduinosketchfolder/libraries folder
that one?
no this one
which is going to be deprecated soon
oh right
so do that
then on the CPB
try compiling n uploading https://github.com/adafruit/Adafruit_TFLite_Micro_Speech/tree/master/examples/nrf52/micro_speech_recplay_neo_nrf52
it wont work
but at least try compiling
yep it compiles and uploads, i can push the button but it doesn't hear my yes
ooo
PDMClass PDM(PIN_PDM_DIN, PIN_PDM_CLK, -1);
then recompile n upload
it oughta recognize yes/no now
mm failed, but lemme try again
ha
hmm
ok it uploaded now
i can input 1 sample, then seems like it dies :/
debugging
yeah there are bugs in that dev
which is why i kinda want to refactor soon
does it recognize anything
or just falls over?
please try 1.8.8 if you are using 1.8.10
right
did you download 1.8.8?
downloading
trying now
yay ok got some serial output
Recording...Done! Recorded 11776 samples
-----------TFLITE----------
ok i see, also works in pyserial now too, just the reset thing
no way around that tho unless there is a special soft reset descriptor
ya makes sense, will use arduino
its smart and knows when you upload, to close the connection
your os can get annoyed otherwise
ya it's not happy now 🙂
ok, so this is kinda where you are on the tflite/speech stuff, modulo refactoring?
ok, did you want my latest tflite?
not yet
bummer this used to work
now it does not
ok bye - we can chat again next week
i may have the new library refactored by then
you can work on the guide page redo meanwhile
if you give me your tflite i can hand test it
aww :/
ok, i'll do the guide
for latest tflite
for tflite stuff you want me to just wait for your refactor right?
i could also try tflite on the pybadge
you cant because you dont have a mic
okidoke l8r!
bye!
Arm AIoT Dev Summit! Mountain View, California, December 2 - 3, 2019
The Arm AIoT Dev Summit is a developer-focused conference that provides a platform for you to exchange knowledge, discuss real-world use cases and solutions, and get hands-on with expert-led, deep-dive training and workshops. Along with like-minded developers, data scientists, and innovators, you will experience technologies enabling the Internet of Things (IoT), Artificial Intelligence (AI) and robotics. AND - Get your hands on free hardware worth up to $500!
@finite fox hi
hi
please start by loading circuitpython onto your edgebadge
do you know how to do that
ok, yeah let me find the page
4.1.0
post a screenshot of the filesystem
rename 0.gif to intro.gif
ok done
reload the trondemo.uf2
using bootloader right?
yes uf2's are always loaded using the bootloader
cool just checking
yep!
we use UF2 bootloader whenever possible
remember you can always BACKUP the code by draggint CURRENT.UF2 off
that's how to make a UF2
ah interesting
ok, so
reloaded tron UF2
ah okay it seems like it's working reliably now, i see arm AI
and then instruction screen
do you have the mic plugged in
yep
did you cut and solder the power jumper to 3.3V
great you should be able to use it, the electret mic is higher quality than the PDM
so it isnt as picky
ooh okay cool!
you can now replace the tflite file
so now i can replace tflite
yes
this demo is flaky i have to refactor it
its based off the old unreleased tensorflow lite codebase
they have a new one, which is way more stable/flexible
same code, but memory structure is better
however this should run for about a minute or rso
and you can use it to test your tflite files
awesome! seems easy enough
umm, i think i just need to update the guide then right?
ok so the colab script
yeah i fixed it up as you wanted
did ya get to updating it to name the folder by date
Fantasy: Learn machine learning! all about neural networks and funny AI weirdness!
Reality: Learn about docker, conda, python module versioning problems.
ok lookin
i wish there was a better way to run training overnight but not have the instance die
well but even if it does thats ok right?
yeah now it's ok with that notebook
cause it will save to the disk before 💀
was just saying generally
aha
so at least on my machine
one major problem is that all of the output gets loaded into firefox memory
and if it keeps doing that eventually tab crash 😦
can we change verbosity?
you can but then you don't get anything interesting
it's just running for hours at a blank screen
or at least when it starts up, it doesn't look like it's doing anything for a while
i think until it hits the first eval checkpoint
so i liked this tradeoff
do you not like having the diff?
it's kinda brittle i agree...
if theres any commandline magic
yeah there are atually two flags
or like, the tensorboard have that show output
which show output are you seeing?
looking for flag names for ya
right so --verbosity sets the log level for non-C++ code
you use os.environ['TF_CPP_MIN_LOG_LEVEL'] for the other stuff
in practice os.environ[...] seems to mostly affect the startup log messages
--verbosity works, but WARN is not very interesting
k
...installing...
haha, ya this is why i wish it would snapshot your VM
hymm something went wrong restarting it
wait the diff is gone?
i think colab is caching things for me
oh no this link is wrong
plz fix
ahh ok
will fix
also i had the git clone commented while i was iterating on the patch part
now uncommented, will fix the link now
ERROR:root:An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line string', (1, 0))
---------------------------------------------------------------------------
CalledProcessError Traceback (most recent call last)
<ipython-input-4-6a00e8ff0c74> in <module>()
22 (training_step, learning_rate_value, train_accuracy * 100,
23 cross_entropy_value))
---> 24 """)
/usr/lib/python3.6/subprocess.py in run(input, timeout, check, *popenargs, **kwargs)
436 if check and retcode:
437 raise CalledProcessError(retcode, process.args,
--> 438 output=stdout, stderr=stderr)
439 return CompletedProcess(process.args, retcode, stdout, stderr)
440
CalledProcessError: Command '['git', '-C', 'tensorflow', 'apply', '-']' returned non-zero exit status 128.```
ok so reload ?
i guess :/
you can't edit it right? i can just give your account edit if that makes it faster
oki doing now
i dont want to
i want to run exactly what you will be putting in the guide
🙂
sounds good--umm, if i change the page it will go live instantly right?
yeah but nobody is using it now
ok
we'll keep the old pages for historical ref
im in another window so if you need something @ me
@finite fox i think i don't have enough magic admin powers to make a new page
don't see the new page button at left
oh i see
no
was not
ah i see--always need to access from within Admin to get there
ok
thanks
@finite fox also when you have a min--i've been scaling all the images down to like 400px because they all need to be indented to keep the guide readable
this is because most of the images are of more text, so if i don't do this you don't even realize it's an image
however i realize this isn't good across devices....so wondering if there is a better way?
here is my new page
Accounts
i just replaced the first image with a full-size screenshot
but what i do now is scale that screenshot to 400px wide
i'd rather scale it in the page editor
i think it looks good
could put white space around it in your photo editor
or a border
either way
could also use a 'side2'
thanks 🙂
i don't like starting long-running computations without being able to see something
i agreee!!
that's probably all for today--i have to head out in about 20 min. but i think next would be either the speech capture guide or hacking more on the pybadge
what do you think?
@arctic talon ok next up speech capture
one "trick" for making an inserted image 'obvious' is cut some non-essential element at one edge in half when you crop it... saves artificially inflating the image size with borders (although "white-space" for preventing eye-fatigue is a thing too... though not necessary for it to be "white") [am I making sense? or confusing things?]
also "drop shadows" look nice if done tastefully
@arctic talon hhihi
@finite fox hey!
so
did you see this thing
hold on i gotta find it
shoot man where did it go
Train a computer to recognize your own images, sounds, & poses.
A fast, easy way to create machine learning models for your sites, apps, and more – no expertise or coding required.
Enjoy the videos and music you love, upload original content, and share it all with friends, family, and the world on YouTube.
no idea
i have not had a moment to try it
so please try it
maybe its good
maybe it does what we want
lotta maybes
well
maybe we could deploy models made with this tool to a raspi OR a microcontroller badge?
next up - please try out this guide
get one nao
also get a display
ha okay 🙂
also get whatever fixin's
srlsy the 4g's are hard to get
so grab one now
yeah that would be an awesome demo!
it probably doesn't generate bounding boxes?
i wonder if it's possible to make a Colab generator site
or something to make it easy to set up colab
do i need a heatsink?
like 82% of max speed w/o it i guess
oh but won't fit with display
you can get a lifter
will also fit underneath
you dont need a fan, it works without
and you can upgrade the firmware - apparently that helps a lot too
prob will skip the fan if the heatsink does enough cooling
do i need to get like a female-to-female header to connect the two boards
?
oh ok great!
oh were you asking if the colab guide is ready?
yeah take a look at that, plus the speech capture notebook is also ready, haven't done a guide for speech capture yet
linky plz
finding link
Accounts
^that's the lifter right?
@arctic talon yep
whoa that thing trains way faster than colab...well, i was using small images but
hmm i might need to try with some different images
stats are all weird on my model. but let me see what it exports
yay!
do you blog on the site?
no haven't done that, pt has usually for me
np ill have him blog it!
awesome, thanks!
last thing i need for raspi...don't know that i have a 2.5A wall wart
is out of stock 😦
do you have a recommended replacement? or maybe 2.1A is ok?
i have an A->C usb cable
you can use your motherboard port
it doesnt really do negotiation
it's just like resistor shorted on one of the data wires/
gotcha
ok i shoudl be able to make do with the A->C cable for now
ordering!
weird, i downloaded my model as regular TF SavedModel but it gave me some garbage...
a labels.txt but no actual model
keras seems more promising, 2.5M
Model: "sequential_4"
_________________________________________________________________
Layer (type) Output Shape Param #
=================================================================
sequential_1 (Sequential) (None, 1280) 410208
_________________________________________________________________
sequential_3 (Sequential) (None, 2) 128300
=================================================================
Total params: 538,508
Trainable params: 524,428
Non-trainable params: 14,080
seems like maybe it's two models attached together
see if maybe someone else has tried this
they gave some example code to try it on colab
i'm just running it
it had 1 trivial bug but it worked otherwise
this was with the keras model format
@arctic talon can you have it run with your first colab detection script
yeah
from back in sept
seems like it
ok please try that next!
i wonder if we can take the speech training demo and flatten it for microcontrollers
i think not
but ill ask tf folx
convert to tflite you mean?
oh! at the time i didnt' know how to do it, but i thought i saw something about that now
let me see if i can find it
can try that too if you want
can you try the speech training demo in your browser when you get a min?
it seemed like my accuracy problems were all related to not clipping the audio sample (i.e. clicking the record/stop button on my laptop made an audible click that was throwing it off)
wondering if you also see the same accuracy
now that i've added a small clip
@arctic talon sorry i am feeling kinda sick
plz send an email ill look later
restig
oh okay, feel better!
@finite fox hey i'm doing the edgebadge guide, but which board library do i need to add to arduino to compile for edgebadge? i updated SAMD boards to 1.5.7 but don't see edgebadge in the list. have to run now but will hack on it more this afternoon
@finite fox oh dear. i updated to catalina and Arduino is not happy. it looks like i might have to update to the latest arduino IDE....but IIRC you had me try 1.8.8. do you know why the latest one is incompatible with pybadge?
the precompiled bouncing ball does work on my edgebadge, though
@arctic talon 1.8.10 should work, i just don't happen to use it.
@finite fox i got micro_speech_arcada to compile and upload to edgebadge, shall i try to replace with a model from teachablemachine?
@finite fox how important is TFLite perf to Adafruit?
@oblique hawk we're not bound by it, but we also like having spacious chips like the '51
i think performance is important to the tensorflow team
they'd like it to run fast on slow chips
@arctic talon im almost positive that will not work
ask in the gitter before you try
however, you should try it on a raspi running TF or TFLite
well - I'm willing to share my first round of optimizations, but I'm also trying to get work as an optimizer with the TF team
as a paid contributor?
From what I've seen, I'm not sure they really care about performance
yes
that's my job and I'm looking for work at the moment
we dont have any insight into how that team hires
the gitter seems to be the fastest way to interact with them
I've interviewed with Pete W and he wanted a warm body in a chair in MV; I only work remotely
yep
the fact that it was so easy to get to 2x means that they really don't have anybody "minding the store" as far as perf
yeah its very very very early
like i submitted a "hey stuff isnt compiliing" issue and its been over a week 🙂
true, but according to them 3B devices are running the code. That's enough to at least put a small effort into optimizing it
what sort of optimization work do you wanna do?
3B???
i dont think that sounds right to me
I'll clean up their SIMD code, fix data locality issues, and fix it on small targets with no SIMD
tflite micro in particular is not well distributed
their approach to all platforms is not quite optimal 🙂
yah
to give you a hint, they're using NEON_2_SSE.H
I can optimize basically any C/C++/ASM code. I don't even have to understand the algorithm too well. I can just spot the common mistakes made by "abstract thinkers"
yah
i may have some mp3 optimziation work later
i want to add mp3 decoding to circuitpython
and the code people are using is from like 15 yrs ago
they don't really know how computers work and do things like dynamic structures in inner loops, unnecessary double precision math, etc
sounds like a fun challenge
BTW - I also wrote my own JPEG codec, so MP3 shouldn't be too bad
let's go private for a moment...
thing is...i dont want ASM optimizations
hiya i have PM's turned off
you can email pt@simple shell if you have questions
again this isnt soon
I do whatever level of optimization the client wants
its a future future thing 🙂
yeah cirucitpy needs to run on a range of processors - MOST are cortex...but some are/will not
I worked for 3.5 years at Google ATAP (various teams including Soli and Spotlight Stories). They got to trust me to just "make it go faster" and it worked out wel
heh i hope some of it shipped
Soli and Spotlight shipped a bunch, a team that I really helped got canned
sux 😦
arduino team and paul s may also be interested in an optimizer
i have to go to a meeting
you can send an email
yes, I rewrote a camera pipeline with some unique ideas and it had great potential
i want to set expectations tho - may not have antying til 2020 🙂
as everyone's on break in lik.... 3 days 😄
well - part of my going to the AIOT summit is to job hunt
good idea!
I was hoping that some non-Google companies would pay $ for better perf. It's usually an uphill battle to convince them they need me, but after they see what I can do, the resistance fades
I also sometimes have to call people's babies ugly - which doesn't go over well
a good summary of recent work/clients --> https://bitbanksoftware.blogspot.com/2018/08/software-optimization-specialist-che-e.html
Recently I've been talking with potential clients and have needed to explain in detail what it is that I do. My title and resume don't do a ...
Anyway, I think I will do a PR for the 2x speedup since it was pretty simple
depends if Google asks nicely 😉
@finite fox ok, in sig-micro?
@arctic talon yah
@oblique hawk ok got email - i realize i have a small project you could tackle
will reply to email later - but our GIF decoder could probably use a scrubbin
@oblique hawk what adafruit hardware/displays do you own?
@oblique hawk I'm happy to chat too if you want to bounce ideas and @finite fox is busy
I've got a few feather boards and 2.2" pitft
nRF52832, nRF52840 and M4 express
Funny you should mention GIF because I wrote my own optimized codec
@ladyada
I see some good opportunities to speed up that code. I'll respond in the email
@oblique hawk ok rad - yeah i dont care if you wanna swap in yr own codec - we just found this one and massaged it until it worked well with our DMA code
Optimized GIF codec? That could be handy, the one I'm currently running is probably not very optimal.
yep
@oblique hawk sounds good - yeah could be up to 5x in there
i do want to make sure that its still modular enough that we can use it in arduino contexts without too much nastiness
do you use static vars in general?
also please work by submitting PR's
and mark me as a reviewer
I didn't restructure the code at all. My first pass changes are innocuous looking, but make a major change in perf due to better file/data handling and using stack vars (which turn into register vars) instead of member vars
@finite fox
okidoke
We can take it to more extremes once I've exhausted less intrusive changes
The main goal of my first pass is no change in structure, no change in portability
yes - we did some palette optimizations you will see. there is some 'profiling' code that prints out speed but you will want to use pintoggles
I use Xcode instruments (for now) 🙂
as the profile code may not be trustworthy
sure - things get fun when you are dealing with QSPI caching 🙂
even though X86 and ARM are pretty different, C/C++ code comes out performing remarkably similarly
sure
the main speedup was from cleaning up the file handling
It's really hard to write fast C++ that has well designed classes. The 2 are at odds with each other.
I can fork the repo and start sharing my changes already to Github
I had to #ifdef a few things for the Mac versus Arduino. I'll pull those out when I'm done
What surprised me is how fast my machine is at running the code. 10,000 decode iterations of a 240x320 file (with output pixels written to a memory buffer), runs in 3.69s of CPU time on a single thread.
GIFs are very old tech 🙂
@finite fox ok, i was able to run one of the teachablemachine models on raspi. i installed an unofficial build of tf 2.0 and it seems to work. the accuracy of my model wasn't very good (teachablemachine only runs for about 50 iterations by default) so i'm not confident in the output of the network other than to say that it detected something
this was just for image recognition
i tried to train a speech recognition model, but it only outputs to JS
@arctic talon does teachablemachine website work well at all?
@finite fox it can create a model and you can download it. there's supposed to be a way to save your "project" to drive, that did not work for me (auth connector busted). also, the speech recognition one basically requires you to use your microphone to record--you can't upload samples easily
I’m really new to the world of ML so this may be a stupid question, but are there any SBCs that can train machine learning models?
@random ibex The Adafruit tutorial on training TensorFlow Lite says, "Give it as many CPUs and as much RAM as you can spare. You need to give it at least 8 GB of RAM or gcc will fail with a very annoying and somewhat confusing error like this (but on some other file)." Perhaps some other ML frameworks are less demanding but single-board computers typically aren't up to that task. https://learn.adafruit.com/how-to-train-new-tensorflow-lite-micro-speech-models
you could train the model on a beefier machine and use a pretrained model on the sbc 😄
Yo! I'm trying to learn some super basic ML, and trying to wrap my head around some example code. A bit confused about the derivative of the sigmoid function, as I've encountered it as the following in two places:
def sigmoid_derivative(x):
return x * (1.0 - x)
But according to a stackexchange post it should be:
(d/dx) σ(x)=σ(x)⋅(1−σ(x))
https://math.stackexchange.com/questions/78575/derivative-of-sigmoid-function-sigma-x-frac11e-x
Are these two the same? Am I just misunderstanding some basic maths?
Oh! I think I got it now. The sigmoid_derivative function looks like that, because x has already been run through sigmoid. My bad 🤦♂️
Hi @raw nymph. It's possible the esp32 might be able to run TFLite since the SAMD51 chips can, but I haven't heard of anybody who has got it running on there.
@raw nymph according to this , it has been ported to the ESP32 -- not much information here though https://www.tensorflow.org/lite/microcontrollers#supported_platforms
google "TFlite esp32" turned up a few github repositories with sparse information....
The Arduino copy of the TFLite code doesn't have any CPU-specific optimizations, so it should compile on all targets
@raw nymph Seen this? It just happened to scroll across my Twitter feed this afternoon: https://towardsdatascience.com/tensorflow-meet-the-esp32-3ac36d7f32c7
Yay!!!
@floral iris what's that clickbait? comes up with a paywall saying i have reached the limit for this month.... i've never been to the site before. please dont spam clickbait
here is some articles with substance https://www.tensorflow.org/lite/microcontrollers https://www.hackster.io/aslamahrahiman/deep-reinforcement-learning-on-esp32-843928 and an example https://github.com/wezleysherman/ESP32-TensorFlow-Lite-Sample
A robot that learns to move towards the nearest obstacle and maintain a minimum distance using deep reinforcement learning on an ESP32. By Aslamah Rahman.
@finite fox the full TF teachablemachine model runs on rpi4 @~10fps now. haven't tried to optimize it much yet. i could try converting to tflite to see if framerate improves, or write up what i've got so far, what do you think?
@arctic talon hi when you are back to working please send email
im not always in discord
Ok, so I've been cursory looking at machine learning, and it sounds interesting to pursue for some experimentation. Is there a good "foundation" book to get the jargon and basic understanding of nomenclature and such?
@quasi pike Yes, there are tons! There's one called "Data Science for Hackers," which will introduce you to statistical methods. The one I recommend for starters, though is this one: https://smile.amazon.com/gp/product/1491962291/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1
There's another one I recommend for beginners. Machine Learning for Hackers. Disregard the section on PCA - it's totally off-base. https://smile.amazon.com/Machine-Learning-Hackers-Studies-Algorithms-dp-1449303714/dp/1449303714/ref=mt_paperback?_encoding=UTF8&me=&qid=
Yes, absolutely. I thought I had linked the 2nd ed, but apparently I missed. Sorry!
Just making sure, it seems this is a fast moving target, so I imagine books "age out" quickly
You should try DNA engineering and gene editing. A researcher at UCSF told me, "use mailing lists, don't buy books. The whole field changes in about six months."
Since "doing" while learning sounded interesting
That one's not bad. I thought you were going for a more general approach. TensorFlow is good for a subset of problems, but there are more general techniques.
Well, that is...part of the issue, Tensorflow lite is what caught my attention....
however, I imagine there is a bunch of back knowledge I need before starting in on a particular package or such
Kinda going at this backwards, the application on MCUs interested me, now I need to understand the beginning to get to there. If that makes any sense?
Oh, there absolutely is, depending on how deep you want to go. The basic techniques are just algorithmic understanding. If you want to modify those techniques, you need a good working knowledge of statistics at least, and analytic geometry, with a bit of linear algebra. Once you get into deep learning, it's calculus.
That's why I suggested the books I did. No (little) math, but a good explanation of ML algorithm implementations, with Python examples.
Cool. Feel free to reach out if you have more questions!
I am at the point of "I heard of a thing that sounds interesting", and am trying to find the way down the rabbit hole 😉
It's a very deep rabbit hole. 🙂 Once you've done ML, if you want, you can branch out into AI....
is exactly at this point.
i'll probably ask some questions here at some point, I have a (non-electronics related) project that will probably use ML, and why not AI ...
@pearl osprey ML is technically a subset of AI, but they're used to solve different kinds of problems. Find out how closely two documents are related - ML (I've done this one). Predict what kind of information security attack is under way and how to respond to it as it collects new data - ML (or Bayesian statistics) (did this one, too). Identifying food web dynamics and extracting predator-prey relations - ML. Taking a fitness function and discovering how to maximize it in a given environment - AI. Identifying objects in pictures - AI (done this). Extracting behavioral patterns from high-volume event data at scale - on the fence, both ML and AI (I've done this one, too - IDS analytics on 14 million EPS data feeds.)
So if you have questions, fire away!
nice. I have automatically classified 3k-4k texts in categories with LDA (so basically ML) to make socio-semantics graphes (who published about what with who) years ago. now i'm trying to code a bot to find an anonymous author given many other attributed texts
style analysis. I already have a few methods I want to implement, but I expect the results to be difficult to analyse, or difficult to add-up some elements with different "weight" in the final decision...
but I will come back with precises questions when I'll need advice 🙂
@pearl osprey Ah, NLP. The method I used (which, coincidentally, identified docs written by the same author, completely unintentionally) was to do the usual NLP parsing bits. Remove punctuation, lowercase, remove stopwords. Each word is a dimension. Each cell contains a list of source documents in which both words appear. You end up with an n-dimensional array (suggest sparse 🙂 ). Then, when presented with a new doc, just extend the Pythagorean theorem to calculate n-dimensional "distance" between the training docs and the new doc.
interesting. the methods I'm reading about don't remove stop-words list, because they try to compare most used words proportion, length of words distribution ... for example
but yeah, I'm coding the data collection first. then the analysis tools and report.
The other thing you can do is write a tokenizer in lex. Then you tell it the stopwords are token separators. The output will be a token stream of phrases not broken by stopwords or punctuation. 😉 I didn't get around to do that one, but it seems the logical next approch. Once you have phrasees then you can play the same Euclidean distance game in n-dimensions....
@pearl osprey (As you can probably tell, my thing is inventing new approaches to things.)
I have an unhealthy fondness for lex and yacc.
Me, too. Of course, in my compiler class we weren't allowed to use them, so we wrote everything by hand. 🙂
is taking notes for future readings
for now I'm playing with accelerometer, TFT displays, sprites etc. back to the basis...
@rancid fossil Just today I learned of tmg, a pre-yacc compiler compiler also done at Bell Labs. https://en.wikipedia.org/wiki/TMG_(language)
TMG (TransMoGrifier) is a compiler-compiler created by Robert M. McClure and presented in 1968, and implemented by Douglas McIlroy. TMG ran on systems like OS360 and early Unix. It was used to build EPL, an early version of PL/I.McIlroy wrote TMG on a piece of paper and "deci...
tmg written in tmg (and I haven't been able to make heads or tails of it fwiw)... https://www.multicians.org/tmg.html
The source of Bob McClure's TMG.
Yeah, TMG was a tad before my time.
It's been noted from time to time that "yet another compiler compiler" is the only compiler compiler that's survived from that time, somewhat ironically.
If it ain't broke?
Or at least it was the least broken of all those contenders. 😄
Like, vi vs. that horrendous editor on the IBM3080?
(vi = not broken) 🙂
And remember when Sun took the C compiler out of Solaris, which is why everyone uses gcc instead of ... whatever the Solaris add-on C compiler was called. LOL!
So many missed opportunities... But I have no reference for anything from IBM3080, and I'm really not sorry to say that. 😄
I had a slight taste of JCL once upon a time and ran fast the other way.
Good choice!
Getting back to textual analysis, I'd be curious to see what this was like in action: https://en.wikipedia.org/wiki/Writer's_Workbench
"wwb's utilities were capable of analysing text for parts of speech, and for word and sentence length, and of comparing the results to established norms."
I've never tried it. I'm fond of Princeton's WordNet, though (even though it's pretty much a dead project.)
(Gratuitous name dropping: I met Lorinda Cherry once at a sports car race, purely by chance, and got to chat with her for a while.)
Not familiar. Can you give me a precis without saying HLMGTFY?