I'm confused and frustrated by my postdoc mentor's stubbornness and not caring for my future at all. What should I do? Background: I did PhD in pure math, then postdoc in medical imaging for 2 years. Because of funding running out, I started a postdoc in France in mesh processing since last 6 months. I'm somewhat proficient in Matlab, which is the only language I'm comfortable in so far. I want to work in R&amp;D of the image processing/computer vision industry.

Facts:
1) It takes a solid 75 minutes each way from my house to my university, and initially we agreed on my showing up 3 times a week. However, sometimes I feel and am way more productive working from home. I tried to discuss this multiple times with my mentor, but he wouldn't listen: he says I've to come 3 times, since other team members might need me, which is NEVER the case, me being in my first year of mesh processing, even the PhD students probably know part of the subject better and I've never been asked a question.

2) My postdoc advisor knows from me that I'm looking for the above type of jobs in industry. Now, for industry purposes, I want to (and indeed started to) learn NumPy and Scikit-learn to perform machine learning. However, he's not familiar with these libraries, and wants me to look at a certain Matlab package he sent me to perform ML, and got offended because I didn't yet. Now, from talking to industry people in imaging/vision, I know Matlab is rarely used compared to Python. I tried to discuss this so that I could use Python to solve his problems, and being better it at the same time. He said "Learn Python on your own time. Since you're not very strong in coding, I can't give you couple of weeks to learn a new language". 

3) My postdoc mentor has a specialty in mesh processing in computer graphics, and most of his papers are about mesh geometry. I get the feeling that he doesn't know machine learning(ML) very well. Now, for my future, and also for our project that involves ML, I want to learn certain algorithms from the scratch, so that it serves me the dual purpose of solving his problems and also strengthens my ML knowledge. He, on the other hand, wants to get fast results, and just wants me to use the above matlab package he sent me, because that's what HE is more comfortable in. 

4) My postdoc is initially for a year only. So basically, I've to either find a job by the end, or get results so that I can renew my postdoc. I did give him some partial results in the first 6 months that didn't involve ML. Now, learning more ML (I know some ML) is taking time, and he's angry about it, accusing me of not progressing fast enough.  So in essence I want to learn the ML algorithms I use from the scratch, but it's not HIS interest, so he'd not just support that. He also said he'd not renew my funding if I don't give him significantly more result.

My mentor has a permanent position, where I don't. I thought postdoc mentors should somehow look after their mentees, but I feel he really doesn't care. Also his stubbornness of making me doing things his way really makes me helpless, and frustrated about my own future. He imposes his stubbornness, since he's not very good in Python, and that he doesn't know ML from scratch.

I've tried to discuss these issues in person, but he literally blew me off. I'm confused what to do. I invite your opinion.
The way you describe your relationship, it sounds like manager and subordinate employee. Regardless of anything else - if that's the dynamic, it would not be surprising he expects you to follow his (effective) orders, and not very interested in promoting your independent future.

I know that many research groups have this dynamic; so it's not as though it can be easily rectified in favor of something else. Still, that's not how a post-doc is supposed to be like - and that depends on him, but also on you.

The way it's supposed to be (*) is:


You're an independent researcher on your own right. Even when you're part of a group, you're supposed to have your own agenda regarding what you'd like to study.
The post-doctoral researcher position is not the same as a 'senior research assistant' or a 'research support engineer' position. In those, the researchers' needs and desires define what you occupy yourself with, almost solely.
As a post-doctoral research you should already have developed, or should now be developing, independent relationships with others in the research community, outside of your group, and the collaboration with them - direct, not just through your research group.
(the part you like) A senior researcher should help his post-docs with their personal development as researchers - but not in a close follow-my-lead-closely relationship as s/he might have his/her MsC/PhD candidates.


So, he's not upholding his side of what's supposed to happen, but frankly - I believe you might not be, either, and what's more, it seems you had not clearly agreed beforehand on a reasonable modus operandi between you two; so you're expecting one thing to happen and he's expecting another.

The bottom-line suggestion is to try to arrange to have a "state of our relationship and mutual-expections-alignment" talk with him that's independent of any specific single issue or grievance any of you might have.

It's hard to make other concrete suggestion without information about your research group, your field, your departmental/university politics etc.

(*) - Again, some would argue that post-docs as plain subordinate grunts with a brain is a valid arrangement. I disagree.