Friday, May 31, 2019

Thoughts on "Should AI Research Try to Model the Human Brain?"

"Should AI Research Try to Model the Human Brain?"

My first thought was: what is intelligence? If intelligence is about being able to learn and apply new things, then whatever we try to come up with needs to be able to learn on its own and then apply that knowledge. The way this happens in the animal kingdom (including human beings) is the use of a brain. Neurons and synapses in the brain form a network, over time and stimulus, that allows learning and the application of learning.

In the past, getting machines to do things was also based on this model of learning and applying. But learning was not autonomous; the machine learns through the program fed in by the programmer. Simple programs evolved into more complex ones simulating learning through the use of more complex mathematical models and concepts.

As computing power increased, the implementation of simple artificial neural networks simulating the way neurons function in animal brains became possible. So now, we have deep learning as another field in machine learning, and we see progress each day. Machines are now able to learn complex games and beat humans at them.

But the model is still the same: a neuron connected to other neurons by synapses. The only difference is that human intelligence is limited by the number of neurons and synapses we can fit into our skulls, while computers are limited by the number of artificial neurons and synapses that we can fit into the computer's implementation in terms of hardware and software; it is limited by our current computing technology.

So is there a better model for learning and applying? We can understanding an AI model for learning and applying that is based on the human brain, because that is something familiar to us. But is our human/animal model the best model? Are there alternative models? Are there better models?

And if there are better models, what is the implication of their very existence? Does it mean the human brain can further evolve to that better model? Or does it mean that there may be a day when intelligent life based on this other model can appear?

Thursday, May 30, 2019

Basic ESP32-CAM sketch

Some time back, I got myself some A.I. Thinker ESP32-CAM camera modules. Basically, these are camera modules controlled by an ESP32 microcontroller.

These modules actually work with the example found in the Arduino-ESP32 core. Which makes them very easy to program. But the example comes with a web interface for configuring the camera, such as resolution, white balance, etc. This web interface takes up quite a bit of flash memory space, actually. In fact, the example needs to be flashed onto the ESP32 using the "Huge app" partition setting in Arduino IDE for the ESP32.

The example also has another problem. It doesn't allow the ESP32-CAM to be used as a network camera on MotionEye. I tried; MotionEye refuses to recognize the module as a valid network camera. I think it is likely the web interface getting in the way.

Searching around, there is this basic sketch which removes the web interface. Wi-Fi credentials need to be put into a separate header file, which is included into the main sketch. And the sketch automatically sets the resolution to UXGA if PSRAM is found, and SVGA if not. The sketch is also small enough to fit into normal partitioning of the ESP32.

An improved version of the sketch can be found here. Basically, the changes are:
1. Wi-Fi credentials moved into the main sketch, just edit them directly without having to come up with additional header file (this may not be a good idea if you are sharing your sketches, but it is convenient otherwise).
2. mDNS is added to allow the camera module to be accessed by hostname; there is no need to hunt around for the IP address. For example,
http://esp32cam.local/
gives access to the video being streamed by the camera module if the hostname is set to esp32cam.
3. Resolution with PSRAM is set to SVGA (800x600) because that seems to be the best balance between resolution and FPS.

Anyway, MotionEye recognizes camera modules flashed with this sketch as a network camera. So when adding a camera, just select "Camera Type" as "Network Camera" and then enter "http://esp32cam.local/" (of whatever you change the hostname to) for the URL. Hook the module up to a small USB power supply, and put them in a corner of the house, and you have your own cheap surveillance camera.

Hurray!! 🎉🎊

Mueller speaks... and reveals a "small" problem with the rule of law in the U.S.


Mueller says he could not charge Trump as Congress weighs impeachment

"Mueller said Justice Department policy prevented him from bringing charges against a sitting president or filing sealed charges, telling reporters it was 'not an option we would consider.'"

So this means the U.S. President can't be charged for crimes discovered during his or her term, even if he or she gets impeached. Wow. So much for the rule of law.

Yes, impeachment remains an effective tool for removing someone from elected office once that person is deemed to be unfit for that office. Yet it is not part of the criminal justice system. It is a political tool, for a political purpose. A person who has been deemed to have committed a crime should have to go through the criminal justice system; no one should be above the law. By saying that the political system is the only way to act against a sitting U.S. President who may have broken the law is akin to saying that the U.S. President is above the criminal justice system; the only way he or she can ever be made to answer under the criminal justice system is to impeach, and then indict. Impeachment itself does not carry the same consequences as indictment; a U.S. President that has been impeached does not end up in prison.

So there was evidence that Trump broke the law, but the criminal justice system does not apply to him while he is in office. Charges cannot be filed and sealed too, which effectively means the findings of this same investigation will not results in charges against him even if he gets impeached. The only way to bring him to justice is to impeach him, and then conduct another investigation to indict him. Hopefully, the evidence found in Mueller's investigation can be used as supporting evidence in that subsequent investigation, if it ever happens.

The U.S. has always tried to sell itself as the shining example of a country adhering to the rule of law. Right now, it just looks more and more like a banana republic.

Sunday, May 26, 2019

Is pounding on Huawei the way to go?

The US has blacklisted Huawei, leading to a series of US-based companies coming out to sever ties with Huawei citing "compliance with the US government's policy." But is this really a good move? As more and more companies join in this "ban Huawei" move, it will only isolate Huawei (and China, since the prediction is that this will eventually spread to more and more Chinese companies), and force Huawei (and other Chinese companies) to come up with competing products and standards since they can no longer use existing US ones.

The outcome? Three distinct possibilities.

1. New Chinese standards and alternatives fail to take off, eventually forcing them out of the global market. Everyone remembers Trump as the person who helped save US supremacy.

2. Competing Chinese products and standards manage to prove themselves as viable alternatives, splitting the market and bringing about a new "Cold War".

3. Competing Chinese products and standards prove to be much better alternatives, causing consumers to switch away from US ones. Trump will forever be remembered as the idiot who helped accelerate US decline.

Which will it be? Only time will tell. But we must remember that there are already Chinese alternatives out there, so Chinese companies are not starting from scratch. It now remains to be seen how fast Chinese companies will strike back.

Saturday, May 25, 2019

Setting up OpenVPN on a Softbank router

This is really more a "note to self" to remind myself how I got everything working.

For months, I have been trying, on and off, to get OpenVPN to work on a Orange Pi Lite which I had lying around. For months, I had not been able to get port forwarding to work on my setup. The main problem seemed to be the Softbank E-WMTA2.3 router that Softbank provided. No matter how I tried, it just would not allow the packets to come through to my OpenVPN server.

First, a note: I have Internet WAN connection via my Softbank E-WMTA2.3 router, which is connected to a ASUS WiFi router that serves as my internal LAN. All devices are connected to the ASUS router. Only the ASUS router is directly connected to the Softbank E-WMTA2.3 router.

I first tried to set up port forwarding on the E-WMTA2.3 router to forward OpenVPN port to the ASUS router, and on the ASUS router, port forward that to my OpenVPN server. But it didn't work no matter how I tried to tweak the settings on my E-WMTA2.3 router.

Then I came across this post (Japanese only) on how to get it working.

Basically, it is to set up PPPoE passthrough on the E-WMTA2.3 router, and then use the ASUS router to connect via PPPoE to the Internet. For that, you will need your PPPoE username and password provided by Softbank. The username should end in "@sbb.ne.jp" or something like that. The password is just a string of random numbers and characters given by Softbank, unless you have changed it subsequently.

Steps (not a detailed walkthrough, more a concept guide):
1. Set up WiFi on the ASUS router. Enable it.
2. Disable WiFi on E-WMTA2.3 router, since the ASUS router will be used.
3. Enable PPPoE passthrough on E-WMTA2.3 router.
4. Set up PPPoE on the ASUS router using the username and password given by Softbank.
5. Set up static IP address for OpenVPN server so that it gets assigned a fixed IP all the time internally. Else port forwarding may get lost.
6. Set up port forwarding to port forward OpenVPN port to the OpenVPN server on the server's static IP.
7. Note down your public IP address. This should be shown in the ASUS router's settings page.
8. Install OpenVPN on the server (in my case, Orange Pi Lite). Use the public IP noted down in Step 7.
(Alternatively, you can use a DDNS service to point a domain name to this address. In my case, I have a domain name registered with enom, so I use their settings page to point a certain hostname to this address instead. There are methods to update enom or DDNS services with current public IP address, Google should provide some answers.)
9. Generate the OVPN files, copy them to the computers you want to use OpenVPN clients on, install the client software and import the OVPN files. This should allow your client computer to connect to the OpenVPN server.

I believe this should work for other services requiring port forwarding, like cloud servers at home. Next would be to try setting up my own NextCloud server. 😉

Tidbits:
Updating DDNS with an ESP32
HOW TO: Enom dynamic DNS updating
Enom Dynamic DNS Update Script
Easy installation script for OpenVPN
OpenVPN on a Asus router

Saturday, May 18, 2019

Update 5 on ESP32-based 3D printer control board

Update on the burning MOSFET situation.

After getting advice from all over the place, it seems that the MOSFET from Aliexpress is most likely the culprit, and not the schematic. So I got myself the same IRLS3034 MOSFET from Mouser. See how different they look. The one from Aliexpress is on the left, the one from Mouser on the right.

After soldering together a new board with whatever I could salvage from the burnt one, I finally found time today to hook it up for a test. The picture shows the board running with both heat bed and hot end being heated (see the two red LEDs).

And good news! The IRLS3034 MOSFET from Mouser did not burn! So it was Aliexpress component at fault after all. I managed to heat the heat bed up to 70 degC. While the area around the MOSFET did get hot, nothing burnt. I threw in a heat sink just to be safe, since without the heat sink, temperatures were reaching 110 degC. Still, with the heat sink, the area around the 20A fuse was getting to around 110 degC. I don't know, maybe the heat is being generated by the fuse.

I am just happy that the heating circuit is working.
Lesson: Some components can be bought from Aliexpress. But for critical parts (high current stuff, or when very precise values are needed), go for a distributor like Mouser and Digikey.

Next would be to find out why the motors are not working... could be because I blew the stepper drivers, but I can't be sure. I will have to find time to work this out.

Note: Issue fixed (see comment). Pre-launch version now available here. Some information on this has been updated here.

Tuesday, May 14, 2019

Clash of giants

Trump to meet Xi after defiant China slaps U.S. with new tariffs

Quick update to the previous post about the trade war between China and the US.

It is unlikely that China will back down from this fight. Not now, not in this situation. Not without losing face, which is something that matters in China (and to Trump). Trump has made the situation one where no one can back down without losing face.

And therein lies the problem.

Both countries are economic giants, and both have the ability to weather a long-draw trade war. The winner to come away from this war, however, is the one who can better control domestic sentiments, and secure alternate markets. Given China's political system, controlling domestic sentiments is probably easier for China. But in terms of securing alternate markets, the US actually has better potential, given its long history of trade within the current international trade system.

The problem for the US, though, is that under Trump, it is not fully exploiting that potential. Instead, it seems to be walking away from it, even undermining it, by economically targeting countries other than China. The US ends up fighting trade issues on multiple fronts, when it should be focusing on a single opponent: China.

China, on the other hand, is trying to secure alternate markets through its Belt and Road Initiative. Unlike the US, which tends to tie economic aid with political ideals, China is selling a new model: economic assistance as an economic transaction, to be collected upon at a later date. Like a bank lending money to companies; the bank is only looking for monetary profits. This appeals to countries which do not subscribe to the ideals held by the US. If this approach bears fruit, China could potentially open up many more alternate markets to help it survive this trade war.

At the end of the day, the Chinese are long-term strategic thinkers. If they do choose to take up this trade war, it is because their projections have shown that China is likely to win it. And that is the scary part: what happens to the US, and the rest of the current international system, when China wins this trade war?

Monday, May 13, 2019

Both side losses in a trade war

China expected to retaliate over Trump tariff hike, economic adviser says

The Art of War teaches one to win without fighting. And I think that was the Chinese strategy. To avoid direct conflict with the US for as long as possible while China grows in strength, until such time when any conflict will inevitably be a Chinese victory, and thereby deterring the US from conflict because it would be a hopeless fight.

Trump probably threw a big spanner at that Chinese strategy with the trade war.

The question, though, is whether the US is sufficiently better than the Chinese in its economy to be able to convince the Chinese that the conflict is hopeless, right now, for the Chinese. That China would be better off bowing down to the US for the time being, and continue to suffer US dominance.

If not, China will have to fight. And in any fight, both side loses. Until the day one of them emerge the winner, both sides will be losing. Even when one side emerges the victor, it will be some time before the victor can recoup the losses from the fight.

Will China fight? Most probably.
Who will win? I would say both sides stand about an equal chance of winning, given their current economic situations.

Is there an alternative? Probably. The US could have taken other, less prominent measures to undermine Chinese progress. But I guess Trump needed the theatrics to help him in domestic politics. It is a gamble, because in any fight, luck plays a part too, and he can lose. And if he loses, he will always be remembered as the US President that lost the trade war to China.

Wednesday, May 08, 2019

People you can work with, or people who can do the work

As a leader, there are times when one can choose his or her team. The question, then, is: do you choose people you can work with, or people who can do the work?

Obviously, the best is to choose people who you can work with and who can do the work. But that may not be necessarily the case in the real world; we all have our own personalities, likes and dislikes, and abilities.

This is actually a very tough question for me. Having been in the navy for many years, the question has never been about choosing a team; in the navy, that is a luxury. With the limited people, you work with what you have, the people you are assigned. Whether you can work with them or not, whether they can do the work or not, the work must be done. The important thing is to work with people to get the work done.

Choosing someone who you can work with makes it easier for you. But not necessarily better for getting the work done. Still, good interpersonal relationships in a team does help to improve team effectiveness and efficiency.

Choosing someone who can do the work is obviously good for getting things done. However, you will probably need to put in quite some effort if you really cannot get along with that person. Effort is then required on your part in order for things to run effectively and efficiently.

So which is it?

I really don't know, and I don't think there is one correct answer. It really depends on the people and the task at hand. What is more important, of course, is to get things done. We just need to make our own judgment calls each time we are faced with this question.

Wednesday, May 01, 2019

What is a Skywalker?

I shared my views about what "The Rise of Skywalker" may mean. After watching this video, which has a largely similar idea, I think I have a clearer idea what "Skywalker" may mean.

I think it is widely known that the Star Wars series by George Lucas is very much about Anakin Skywalker. As Darth Vader in the original series, his path to Darth Vader as Anakin Skywalker in the prequels, and his legacy as carried on by his grandson, Kylo Ren, in the new sequels. A family of strong Force users.

But then comes in Rey, who has not been directly connected to Luke or Leia, yet is a Force user, and a strong one at that. And somehow, she is going to be connected to this "rise" of Skywalker.

Maybe, like Anakin, Rey was born from the Force. Episode 8, The Last Jedi, had scenes of young Force users too.

Maybe, just maybe, Skywalker is not a family, but rather, a term used to refer to those born from the Force, starting with Anakin, but subsequently Rey and others.

Which means that while the "Skywalker" family related by blood to Anakin Skywalker (Luke and Leia, and Kylo Ren) is a narrow branch, there is a wider "Skywalker" family comprising all those born from the Force, of which Rey may be one.

And the "rise of Skywalker" may be referring to the rise of those born from the Force. A new era. For good and for bad. Much like how the death of the God Emperor in Dune led to the Scattering and a new diversity in human civilization, maybe the passing of Luke has led to a new era of new Force users, born from the Force, that brings diversity to the Force-wielding galaxy.

What do you think?