Pages

Try try try again!!!

 The other day, I saw comma.ai founder Hotz trying Jupyter Noetbook in the recenly released Apple M1. The duration of the video, I think a few hours.

In the first few minutes he encounter an error. 

He tries to solve by installing packages. But, problem unsolved.

Then, he tries to identify the cause of the problem.

Then, again, again, again, again, ....he is trying to solve the problem.

Then, he uses debugging packages.

First he try but not useful.

Then, on the live stream some suggest to use another debugging package.

He uses that.

That is also not easy. He tries again and again.

Finally he find the exact problem by identifying the function that causes, and know how to solve it.

This is the first time, how for even an expert in coding how difficult is coding.

Now, come to another situation.

The documentary "The Dawn Wall". 

The climber tries again and again and again to become successful. He fails a lot of time.

So, in order to achieve anything great you have to keep on trying. On the way, you will encounter one or more problems which are extremely difficult. But, you have to keep on trying again and again and again even after continuous failure. It will lead to success.

This can be applied to any field.

You are doing research and you did not get the required property or want to tune the property to the required level. If you didn't put this much effort, you will never get significant research results which can be influential.




Using Jupyter notebook in Apple M1: Error 2850 Segmentation fault

 In the live video stream by George Hotz titled, "Programming | tinygrad: neural engine on M1? | Science & Technology | Apple M1 | Part4"

He almost spent 1 hour to find out what causes the error and debugging.

He uses a number of installations, cloning repositories, debugging, installations, etc.

Here is the solution he found.

Install faulthandler as follo.

pip3 install faulthandler  

(if your python version is higher than 3.3, it is inbuilt)

The error is in the use_app_nope package.

Just comment out it. The problem solved.

For more detail, you can watch the full video. 

Or you may watch the video at https://youtu.be/mwmke957ki4?t=2929








Geoffrey E. Hinton's advice for students (from Coursera)

This part is taken from an Interview of Prof. Geoffrey E. Hinton by Prof. Andrew (in Coursera course)

What is your advice to students to want to pursue a career in Deep Learning?

(I thin that the answer given by Prof. Geoffrey E. Hinton is useful to any researcher irrespective of the field of research)

Here is the answer.

"Read the literature, but don't read too much of it. So this is advice I got from my advisor, which is very unlike what most people say. Most people say you should spend several years reading the literature and then you should start working on your own ideas. And that may be true for some researchers, but for creative researchers I think what you want to do is read a little bit of the literature. And notice something that you think everybody is doing wrong, I'm contrary in that sense. You look at it and it just doesn't feel right. And then figure out how to do it right. And then when people tell you, that's no good, just keep at it. And I have a very good principle for helping people keep at it, which is either your intuitions are good or they're not. If your intuitions are good, you should follow them and you'll eventually be successful. If your intuitions are not good, it doesn't matter what you do."

[Prof. Andrew Ng: I usually advise people to not just read, but replicate published papers. And maybe that puts a natural limiter on how many you could do, because replicating results is pretty time consuming.]

"Yes, it's true that when you're trying to replicate a published you discover all over little tricks necessary to make it work. The other advice I have is, never stop programming. Because if you give a student something to do, if they're botching, they'll come back and say, it didn't work. And the reason it didn't work would be some little decision they made, that they didn't realize is crucial. And if you give it to a good student, like for example. You can give him anything and he'll come back and say, it worked. I remember doing this once, and I said, but wait a minute. Since we last talked, I realized it couldn't possibly work for the following reason. And said, yeah, I realized that right away, so I assumed you didn't mean that. "

[Prof. Andrew Ng: ny other advice for people that want to break into AI and deep learning?]

"Basically, read enough so you start developing intuitions. And then, trust your intuitions and go for it, don't be too worried if everybody else says it's nonsense."

"If you think it's a really good idea, and other people tell you it's complete nonsense, then you know you're really on to something."

I think that this advice is applicable to any technical field. Some researchers spend too much time on reading and this lead to too much bias in the published results. If researchers read just enough so that they can think and work on a problem, they can contribute something new in that field. Otherwise, they will be doing just what others have done (mostly incremental work).

Another thing I understand is that students and researchers should try to replicate seminar research papers from the scratch. This help the researchers understand the process the top researchers have undertone. This often provide the skills needed to find out something new in that field and contribute novel works in that field.


Reference:

Weblink: https://www.coursera.org/learn/neural-networks-deep-learning/lecture/dcm5r/geoffrey-hinton-interview


How to add math equations in blogger using LaTeX or MathJax?

Here is the website mathjax.org website and you can find the demo here.

In the demo page, you can see following equation written in latex or mathjax equation. 

When $a \ne 0$, there are two solutions to \(ax^2 + bx + c = 0\) and they are

If you write $x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$,


you will get follwing formatted equation.

When $$a \ne 0$$ there are two solutions to \(ax^2 + bx + c = 0\) and they are $$x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$$
To write such beautiful equations using either mathax or LatTeX in your blogger post or blogspot domain blog, you can do following steps. This is also true for any website if you want to write a code using HTML and other programming languages.
  1. Go to this MathJaX getting started page and copy the code (or simple copy the code below)
  2. Go to Themes in your blog on blogger
  3. Chose Edit HTML
  4. Paste the code (copied from mathjax.org) just below <head> tag[The <head> tag probably will be within 10 lines of code in there]
  5. Save and you are now ready to write LaTeX code or MatJaX code in Blogger.
The code is here [If you want copy this too.

<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>

Now, you are ready to write beautiful math equations using either LaTeX or MathJax.

If this post is useful you can comment here for visibility of this post as well as this blog.

Do you have any other suggesstions? You can add here.

Thanks. 


They do better by going to school less!

The schools in Finland are the model for the entire world. They do better by spending less in the school.   

   

What are the languages they speak? Most students name atleast two languages.
  • English 
  • Swedish
  • Finnish
  • German
  • French

  • How these students are able to learn this may languages despite spending less time in school than many countries? 

    Strange and counter intutive points from here.

    1. Less home work
    2. Say no to multiple choice questions
    3. School is about finding your happiness finding what you know, finding what you learn and what makes you happy
    4. Teach everything to kids: music, singing, art, drawing, etc.
    5. When you move to a new city, we don't ask for the best school. It is never a question. Because all schools are same.
    5. There is nothing different from one school to another in the entire country. They are all the same. 
    6. It is illegal in Finland to set up a school and charge tution. This makes sure that the rich parents have to make sure that the public schools are great.

    The one thing i disagree in this video is about what to tell people on what they want to be. I defer from what the teacher at 7:10 says telling that you can be anything you want to be when you grow up is a lie. Even though it is a lie, at very young age (atleast 15 years old) the interest of the students should as diverse as possible. They should not be forced to focus on a single thing unless the wanted. Isn't completely different from the core idea of the video?

    What makes the students to like something or unlike something? It is entirely based on the way they are brought up, the people they meet, the environment. In such environment, it is not a correct way to focus on what the students want. I am not sure at what age the students focus should be narrowed down. 

    The end of the video says very important points.

    1. Try to teach kids to think for themselves
    2. Be critical to what you learn
    3. Try to teach student sto be happy person 
    4. Teach to respect to others and themselves.

    Another followup video (which Youtube suggested after watching the above video)

    What if Finland's great teachers taught in your schools?


    Why we need to spend more money on energy related projects?

    You can calculate the amount of money each country spends (each year) on gasonline (petrol or diesel or gas). Surely, it will be in many 10s of billions. Now, calculate last year's budget on energy research. If you compare these amounts, surely the later will be insignificant. Are the we ignorants? 

    Here is a short video by Bill Gates. 


    This is is really mind blowing. Are you satisfied with what your country spends on energy related research? Comment here.

    Working with Matplotlib and Pandas (Python package for graphs)

    import pandas as pd
    import matplotlib.pyplot as plt

    file = pd.read_excel('/full/path/to/file.xlsx')

    When you run this, you may get following error.

    ImportError: Install xlrd >= 0.9.0 for Excel support
    To proceed further, install xlrd package using
    
    pip install xlrd or pip3 install xlrd



    For mentioning the sheet number in the excel sheet import.

    df =pd.read_excel('fileName.xlsx', sheet_name='Sheet4')


    Python Class: A simple and clear explanation.

    I have been trying to understand class in python and failed to use it any useful purpose. Then, I came across this  webage where I got a clear understanding of Class in Python. To understand this, I went through so many pages and blogposts. But I didn't get it. 

    https://micropyramid.com/blog/understand-self-and-__init__-method-in-python-class/

    See the code blow (taken from above link). 


     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    class Car(object):
      """
        blueprint for car
      """
    
      def __init__(self, model, color, company, speed_limit):
        self.color = color
        self.company = company
        self.speed_limit = speed_limit
        self.model = model
    
      def start(self):
        print("started")
    
      def stop(self):
        print("stopped")
    
      def accelarate(self):
        print("accelarating...")
        "accelarator functionality here"
    
      def change_gear(self, gear_type):
        print("gear changed")
        " gear related functionality here"
    

    This code is an example for a class in python language.

    As you can see, this is a collection of functions (def) grouped in a class named Car. 

    What is the use of Class?

    Class is used to collect list of definitions and provide a functionality to crosscommunicate with all other definitions inside the Class. 

    What is the best explanation for Class? Do you have any link? 

    Comment and provide link here. 

    Thanks. 

    Postdocs: Dos and Don'ts for getting tenure

    I read an intereting article "What 50 principal investigators taught me about my failure to land tenure" by Bela Z. Schmidt’s. 

    After multiple postdocs for long years, and failing to get a tenure, the author provide eight pieces of advice for researchers. Here is what I understood from this article. 

    1. Don't over check your results. Believe your data:
    After getting very good result, most of the time, you may have a feeling that the result is good and anything wrong with the experiment, or calculation. These kinds of thinking should be avoided. Of course, you should cross check your data and confirm that they are correct. But, too much thinking would not be healthy. The author simply put this as "Accept your data".

    2. Don't ask what I should do further. Instead, tell what you have done and got and what you are going to do further.
    Most of the postdocs ask their supervisors what should they do further. Instead, you take responsibility to the project, do experiments, calculations, and everything without waiting for an approval. Do something useful and get progress and inform to the supervisors that you have done this and that and got this result. In addtion, you may give a hint on what you are going to do further. This would be useful to get feed back and advice from your supervisors.

    3. Don't think like a postdoc. You treat yourself like a co-PI.
        Treat your supervisor as a future collaboration and you like a co-PI of the current project. 

    4. Have confident in what you are doing.
        Some times, your supervisor may not realize the importance of a result. If you beleive that something is important, do it and try to convince the importance of your experiment or calculation or result.

    5. Keep track on the timeline of the project and publish as soon as you get results.
        As a postdoc, the term will be renewed every year or so. This is the time to show your potential in a short duration of the time. Publish your results at as soon as you get results. This will also increase the chance of getting renewal and a good boost for you.

    6. Think ahead what you want to do next.
        While in Ph.D, think about what you want to do in postoc. During postdoc, think about what you want to when you join an institution and where would you apply. Always think ahead of future.

    7. Take decision quickly and act on it.
        You should take quick decision and act on it. At the same time you should have multiple ideas and have to follow your intution.

    8. Finish what you start.
        Michael Faraday said "Work, Finish, Publish", finish what you start and publish. If you are trying to unravel big problems, reveal as soon as you find some thing. 
     




    Postdocs: What they should know?

    “I don’t feel that anything significant that I’ve done has been truly independent,”.

    This Nature article on "The quest for postdoctoral independence" ends with this quote. I also feel the same.

    This articles provide important points. I compare with the points provided here in another articles from TimesHigherEducation.com article 10 habits for a successful postdoc

    Take ownership of your project.
    Read broadly and learn more about research.
    Learn how to train people.
    Learn how to write scientific papers, and learn how to give scientific talks
    Position yourself to get good letters of reference.
    Learn organisational skills.
    Be a good citizen of the lab and the department.
    Network.
    Learn how to write grants and apply for your own funding.
    Finish papers before you leave your postdoc.

    Interetigly, only a few points match between these two article. While most of the postocs do what is given in above points, many postdocs fail to do what is mentioned in the Nature article. 

    You just need to prove that you have the skills, expertise, collobrative skills, communicative skills, fund writing skills, getting grant, articulative skills, ect in order to convince any committe to land in tenured jobs. These skills would be of great help regardless of whether you prefer academia or industry.

    Big tech companies look for those who has these skills with PhDs. Having just Ph.D is not enough for companies. 

    What do you thing about this? Leave a comment. 


     

    You may be interested in these posts

    Error in image file conversion: convert-im6.q16: not authorized `test.eps' @ error/constitute.c/WriteImage/1037.

    This error is because of the vulnerability. This allows remote execution of code using image formats. So, some Linux distributions by defaul...