Sign Up Now!

Sign up and get personalized intelligence briefing delivered daily.


Sign Up

Articles related to "example"


Use comments to unit test your code.

  • At Supabase we love writing as little code as possible, so we decided to combine our unit tests with same JSDoc comments that power VSCode's IntelliSense.
  • JSDoc has a tag, @example, which shows a developer how to use a documented item.
  • So we decided it would be pretty cool to implement the same functionality with Javascript: @supabase/doctest-js.
  • Doctest-JS uses a very similar format to Elixir's Doctests, using //=> to specify return values.
  • Create a JSDoc style @example on any functions that you want tested.
  • Import the doctest function in your test suite and point it at the file.
  • And then simply run node test and you get well documented, tested code, without having to maintain any additional code.
  • Watch and star doctest-js to keep updated about new releases.

save | comments | report | share on


Use comments to unit test your code.

  • At Supabase we love writing as little code as possible, so we decided to combine our unit tests with same JSDoc comments that power VSCode's IntelliSense.
  • JSDoc has a tag, @example, which shows a developer how to use a documented item.
  • So we decided it would be pretty cool to implement the same functionality with Javascript: @supabase/doctest-js.
  • Doctest-JS uses a very similar format to Elixir's Doctests, using //=> to specify return values.
  • Create a JSDoc style @example on any functions that you want tested.
  • Import the doctest function in your test suite and point it at the file.
  • And then simply run node test and you get well documented, tested code, without having to maintain any additional code.
  • Sore eyes?
  • Go to the "misc" section of your settings and select night theme.

save | comments | report | share on


I built a DIY license plate reader with a Raspberry Pi and machine learning

  • And since I already had a hardware system that could record, I decided to use mine to drive around the town for a few hours and collect frames to finetune the above guy’s model.
  • The client in our case is the Raspberry Pi and the cloud APIs to which the inference requests are sent to is provisioned by cortex on AWS (Amazon Web Services).
  • For example, converting the models to use mixed/full half precision (FP16/BFP16).
  • Making the models use mixed precision will have a minimal impact on the accuracy, generally speaking, so it’s not like we’re trading off much.
  • This means that a model that has been converted to use single/mixed precision can take up to 8 times less time to do an inference, and respectively a tenth of a time on a V100.
  • I haven’t converted the models to use single/mixed precision because this is out of the scope of this project.

save | comments | report | share on


I built a DIY license plate reader with a Raspberry Pi and machine learning

  • And since I already had a hardware system that could record, I decided to use mine to drive around the town for a few hours and collect frames to finetune the above guy’s model.
  • The client in our case is the Raspberry Pi and the cloud APIs to which the inference requests are sent to is provisioned by cortex on AWS (Amazon Web Services).
  • For example, converting the models to use mixed/full half precision (FP16/BFP16).
  • Making the models use mixed precision will have a minimal impact on the accuracy, generally speaking, so it’s not like we’re trading off much.
  • This means that a model that has been converted to use single/mixed precision can take up to 8 times less time to do an inference, and respectively a tenth of a time on a V100.
  • I haven’t converted the models to use single/mixed precision because this is out of the scope of this project.

save | comments | report | share on


I built a DIY license plate reader with a Raspberry Pi and machine learning

  • And since I already had a hardware system that could record, I decided to use mine to drive around the town for a few hours and collect frames to finetune the above guy’s model.
  • The client in our case is the Raspberry Pi and the cloud APIs to which the inference requests are sent to is provisioned by cortex on AWS (Amazon Web Services).
  • For example, converting the models to use mixed/full half precision (FP16/BFP16).
  • Making the models use mixed precision will have a minimal impact on the accuracy, generally speaking, so it’s not like we’re trading off much.
  • This means that a model that has been converted to use single/mixed precision can take up to 8 times less time to do an inference, and respectively a tenth of a time on a V100.
  • I haven’t converted the models to use single/mixed precision because this is out of the scope of this project.

save | comments | report | share on


I built a DIY license plate reader with a Raspberry Pi and machine learning

  • And since I already had a hardware system that could record, I decided to use mine to drive around the town for a few hours and collect frames to finetune the above guy’s model.
  • The client in our case is the Raspberry Pi and the cloud APIs to which the inference requests are sent to is provisioned by cortex on AWS (Amazon Web Services).
  • For example, converting the models to use mixed/full half precision (FP16/BFP16).
  • Making the models use mixed precision will have a minimal impact on the accuracy, generally speaking, so it’s not like we’re trading off much.
  • This means that a model that has been converted to use single/mixed precision can take up to 8 times less time to do an inference, and respectively a tenth of a time on a V100.
  • I haven’t converted the models to use single/mixed precision because this is out of the scope of this project.

save | comments | report | share on


Amb

  • The Amb operator takes a variable number of expressions (or values if that's simpler in the language) and yields a correct one which will satisfy a constraint in some future computation, thereby avoiding failure.
  • Problems whose solution the Amb operator naturally expresses can be approached with other tools, such as explicit nested iterations over data sets, or with pattern matching.
  • The goal of this task isn't to simply process the four lists of words with explicit, deterministic program flow such as nested iteration, to trivially demonstrate the correct output.
  • Note that amb here is roughly equivalent to the Ambassert in the task description, and that the corresponding Ambsel is unnecessary and trivial (if needed, we could define Ambsel as the identity operation and make these examples slightly more verbose).

save | comments | report | share on


Charming the Python: File Handling

  • If coding tutorials with math examples are the bane of your existence, keep reading.
  • This series uses relatable examples like dogs and cats.
  • File handling allows you to create, read, update and delete files.
  • I assume this is where CRUD comes from.
  • If you write a file that doesn't exist, it will create one.
  • Here's an example.
  • If the file doesn't exist, it can't remove it and will give an error.
  • For this case, it may be good to use an if-else condition.

save | comments | report | share on


Machine Learning 101 — Artificial Neural Networks

  • The first thing you’ll learn about Artificial Neural Networks(ANN) is that it comes from the idea of modeling the brain.
  • This neural circuit is a neuron and has inputs with weights, accordingly and goes out as a calculated output.
  • In single layer perceptron x represents inputs, w represents weights and θ represents the threshold value.
  • Example 1: Let’s map the OR operation to a single layer perceptron by using a step function.
  • In the backward pass, using backpropagation and the chain rule of calculus, partial derivatives of the error function w.r.t. the various weights and biases are back-propagated through the MLP.
  • Example 2: Let’s map the XOR operation with multi layer perceptron by using a step function.
  • Artificial Neural Networks(ANN) is a good start for Deep Learning.
  • In this post, I intended to explain the types of ANN and the base calculation to adjust weight values in the core of them.

save | comments | report | share on


Machine Learning 101 — Artificial Neural Networks

  • The first thing you’ll learn about Artificial Neural Networks(ANN) is that it comes from the idea of modeling the brain.
  • This neural circuit is a neuron and has inputs with weights, accordingly and goes out as a calculated output.
  • In single layer perceptron x represents inputs, w represents weights and θ represents the threshold value.
  • Example 1: Let’s map the OR operation to a single layer perceptron by using a step function.
  • In the backward pass, using backpropagation and the chain rule of calculus, partial derivatives of the error function w.r.t. the various weights and biases are back-propagated through the MLP.
  • Example 2: Let’s map the XOR operation with multi layer perceptron by using a step function.
  • Artificial Neural Networks(ANN) is a good start for Deep Learning.
  • In this post, I intended to explain the types of ANN and the base calculation to adjust weight values in the core of them.

save | comments | report | share on