Friday, August 31, 2018

Forecasting aftershocks using deep learning

Forecasting earthquake aftershock locations with AI-assisted science

This seems like interesting research, especially since I live in Japan now, where earthquakes are really common.

But a look at the database used for the earthquake data seemed to suggest inadequate data. The database contains information on 178 earthquakes as of Aug 14, 2018. Most of the data comes from 1960s and later. It also contains earthquakes with varying magnitudes from 4+ to 9+, but given that earthquake magnitudes are logarithmic, we should expect a lot more 4+ earthquakes compared to 5+, and so on up the scale. Specifically, being in Japan, I know we have a lot of 4+ and 5+ earthquakes in recent years, but they are not reflected in the database. It therefore seems the database may have some inherent data bias, which is obviously not good since any bias in the data will be reflected in the model learnt from it.

So while I applaud the idea, I think there can be improvement to the actual research method (specifically, the data selected). Maybe they should work closer with the Japan Meteorological Agency to obtain a more comprehensive set of earthquake data around Japan, for a geographically limited model first. This can then be expanded to cover other regions in the world where the local authorities have good systems in place to capture and record such data.

Wednesday, August 29, 2018

Annealing PLA+ with hot water

I saw a video on Youtube about using hot water to anneal PLA. So I tried it on my Sunlu PLA+ and here are the results.

Original cube measurements:
X: 19.9mm
Y: 20.0mm
Z: 19.7mm

Post annealing:
X: 19.5mm (2% shrink)
Y: 19.6mm (2% shrink)
Z: 20.1mm (2% increase)

It seems that annealing has made the cube grown in height (Z) like in this video.
Theoretically, it also means that I can compensate for these shrink/increase by scaling the object up/down in the respective axes before printing. Theoretically. I may try it out some day.

My method:
Boil water in a pot.
Put cube in a ziploc bag.
Put ziploc bag into pot of boiling water.
Wait for 2 minutes.
Pour boiling water away, fill pot with tap water.
Wait for 1 minute.
Take ziploc bag out of pot, take cube out of ziploc bag.

For those who may be interested.

A framework for a generic learning AI?

There has been a lot of progress made in AI on developing neural networks which can be applied in a more generic sense.
Measuring abstract reasoning in neural networks
Capture the Flag: the emergence of complex cooperative agents
OpenAI Five Benchmark: Results

A common feature of AI using neural networks for deep learning is the training that must be done. The problem is that most AI can only learn to do one thing. Play a certain game, for example. The AI trained to play DOTA won't be able to play Quake.

It got me thinking: how can we training an AI to be able to do different things?

Maybe it is as simple as having three distinct portions of the learning algorithm.

An input/output (I/O) layer which is tailored for the task being learned. This takes in raw data from the "environment" and outputs actions back into the "environment."

An I/O conversion layer that acts as a translator between the actual AI, and the I/O layer. Nothing really fancy here, although this is probably where we need to sort out features from labels (rewards?). This conversion layer changes data into concepts for use by the actual AI.

And the actual AI layer(s) which does the learning and prediction. Since it works with concepts and not raw representations, it should be better able to adapt to different circumstances, and reused learnt concepts in new environments.

It also means researchers can split their work into various focus groups. The concept-learning AI itself, which is the holy grail for machine learning. Or the conceptualizing conversion layer, which is an enabling research, and does affect the subsequent AI since the quality of conceptualizing will affect the concepts available for learning.

Whatever the case, I am looking forward to seeing how AI research progresses in the future.

Monday, August 27, 2018

Upgrading Linux Mint 18.3 to Linux Mint 19

Note to self:
Do not upgrade via mintupgrade on a highly customized installation. It will FAILED and you will not be able to recover...

Okay, so I did the stupid thing. I tried to upgrade to Linux Mint 19 using mintupgrade (following all the steps here). Everything went well, no error messages even with mintupgrade check and mintupgrade download.

All hell broke loose when I ran mintupgrade upgrade.

Error messages one after another. Tried to fix using dpkg and apt remove, and eventually managed to finish running mintupgrade upgrade.

But it won't boot.

So now I am waiting for a new SSD to arrive so that I can install a fresh copy of Linux Mint 19 on it, while porting over my previous home directory.

When will I ever learn...😭

Separate note, the same steps for upgrading worked on another PC, which runs Windows 10 as the main OS, with Linux Mint installed as a dual boot which I occasionally use. But the installation is not as customized since it isn't used as often, so I guess that helped to smooth the upgrade.

Sunday, August 26, 2018

Senator John McCain dies at 81


Rest in peace, sir. Thank you for your service to your nation, and through that, to the world.

Saturday, August 25, 2018

Will Ivanka flip?

I think Ivanka is going to flip. She knows the prize is her father, and she is going to give prosecutors that prize in exchange for her freedom. But she also wants her inheritance. And power. So she is probably going to convince her father that flipping is for his sake. She will pardon him when she becomes the first female President. And she will then use it as a selling point. "My loyalty is to the United States and her people. I even flipped on my father."

When she does get elected, she can always find ways and means to either delay the pardon, or give one (whatever suits her at that time). And if she doesn't get elected, she can always tell Daddy, "Look, I tried!" And she can keep trying.

So Ivanka flipping on her father is a win-win for her. She just needs to play her cards right. The question then, is whether Weisselberg and Pecker has enough dirt on her. If she thinks they have, she is going to flip to save herself. 

Thursday, August 09, 2018

Happy 53rd birthday Singapore!

Always great to be around to celebrate the nation's birthday!

Happy birthday Singapore!

Monday, August 06, 2018

73 years on

73 years have passed.

Let's not tread the same steps. Let's not forget.

Sunday, August 05, 2018

Visiting Maker Faire Tokyo 2018

It was a hot summer day, but I dragged myself down to make the one-hour trip to Tokyo Big Sight to visit Maker Faire Tokyo 2018.

This was my first time at a maker fair, so it was really a new experience and an eye-opener for me.


Just outside the exhibition space, there was an area for kids to work on projects.
 





The guys from Ultimaker, Prusa Research, and RepRap Japan were here too!
 
 
Prusa Research was showing off their new Multi-Material Upgrade 2.0, which is able to use up to five different materials at the same time. Cool!



M5Stack was here too, with their CEO Jimmy Lai. I was a bit shy, so I didn't talk to him. But he brought the M5Stack family (series) with him, plus all those stuff he was using the M5Stack for, like the piano.




There was also a booth where you ca have shoes made to fit your feet just by taking photos of your feet. It reminded me of a conversation I had with an ex-colleague on exactly the same thing! But that conversation was like two years ago. Still, it is interesting to see an idea take shape.
 

Lego was there too, right at the entrance, where the Kids & Education area was.




And even Star Wars was represented at the exhibition, with DIY droids and lightsabers.




Someone made a UUV from PVC pipes.

There were homemade rockets too!
Some of them even looked like missiles (see the one in the background).

Someone was even trying to make a full-size tank!

And there was a group which makes satellites. These satellites would take pictures of the Earth and send them back. When the satellite's life expires, it literally drops out of the sky, becoming a falling star.
These satellites are filled with pieces of paper with wishes written on them, burning up these wishes as the satellite falls through the atmosphere as a falling star. Sure way to make a wish upon a falling star.


And many many many years ago, when I was a student, I used to take part in micromouse competitions. So seeing them brings back memories. Though during my time, the mice were much bigger.





All in, I spent slightly more than 2 hours at the maker fair, just walking and glancing, not really looking in detail or asking questions. If I did... I would be there till closing! It was a great experience seeing what others are doing, and what can be done. I am inspired by them and hopefully, I will be one of them next year!


Wednesday, August 01, 2018

Editing STL files in FreeCAD

I have been learning about 3D printing, and one of the things which stumped me has been how to edit STL files posted on the Internet (at sites such as Thingiverse).

Then I found FreeCAD, an open source CAD software. And Google brought me to an article on how to convert STL files into solid shapes that can be edited in FreeCAD. Except that it missed an important step.

My original workflow (missing important steps):
1. Import STL file.
2. In Parts workbench, select imported mesh and select "Create shape from mesh" in the Parts menu.
3. Select the newly created shape, and select "Convert to solid" in the Parts menu.
The result is a solid that can be edited. But very messy, with surfaces being made of triangles.

Then I decided to do the right thing: read the documentation. And came upon this page titled "Import from STL or OBJ" in the wiki. And realized the important steps I had been missing.

The documentation's workflow, in summary:
1. Import STL file.
2. In Mesh Design workbench, select the imported mesh, and Mesh->Analyze->Evaluate & repair mesh. Analyze and repair as necessary.
3. In Parts workbench, select imported mesh and select "Create shape from mesh" in the Parts menu.
4. Select the newly created shape, then "Refine shape" in the Parts menu.
5. Select the refined shape, and select "Convert to solid" in the Parts menu.
This gives a much cleaner solid, with proper flat surfaces made of rectangles (and curves are stringed rectangular surfaces). Which is definitely better on the eyes, and easier to edit.

(This is basically a note to myself, just in case I forget the process.)