Movies, and engineering.

Menu Close

Page 2 of 4

Installing Apache MXNet Python library Windows 10

Hello, hello.

I wanted to share a quick how-to install MXNet on Windows 10 64-bit.

The solution here is a bit opinionated as I am using Anaconda to manage Python environments.

I will start from the beginning – Anaconda installation.

We will need Anaconda 4.3. You should use 64-bit Anaconda/Python 2.7 combination, as the environment we will create will be based on Python 2.7 64-bit in order to support MXNet. You can get anaconda here:

https://www.continuum.io/downloads

Follow the installation instructions and once it is done, lets go to the windows command line and type this:

having ‘anaconda’ argument in there will ensure we have common data analytics libraries, that are not necessary for MXNet, but nice to have. Also, we want to use Python 2.7 in this case, as MXNet has compatibility issues with Python 3.

Once the environment creation is complete, activate it by executing:

It is all for the terminal so far.

Lets get pre-combiled MXNet dlls!

You will need to download several packages from

https://github.com/yajiedesign/mxnet/releases

First, get the prebuild VC14 ( Visual Studio runtime 2015) package, it doesn’t contain any specific binaries, but it provides 3rd party libraries and helps to set all the environment variables that are necessary to run MXNet. In my case I got prebuildbase_win10_x64_vc14 

Once you download VC14 base archive, extract its contents somewhere. A good folder candidate would be ‘mxnet’ in the root of C: or any other drive. Let’s imagine that you have created ‘D:\mxnet’ folder.

Open terminal in that folder an run

It should finish quickly. You can verify that it was successful by going into the System -> Advanced System Settings and making sure it has MXNET_HOME:”D:\mxnet” environment variable setup.

Now, lets download GPU or CPU version of pre-compiled MXNet from the same page where you got the base package. At the moment of writing it is 20170702_mxnet_x64_vc14_gpu.7z

We won’t need the source code of mxnet, as we are not going to compile it from scratch, so you can IGNORE Source code (zip)

The archive will have contents that you need to extract to “D:\mxnet”, it might overwrite some of the folders, which is ok.

Optional STEP:

Now, if you used GPU version of MXNet, the last part would be is to get the cuDNN nVidia library for windows, you will have to register to get it, but essentially it is free.

cuDNN is available here:

https://developer.nvidia.com/rdp/cudnn-download

Once you download the archive, extract its contents to “D:\mxnet\3rdparty\cudnn”.

END OF Optional STEP.

It is time now to try to install python binding, so you can import mxnet inside a python project.

Go to the terminal where you had your MXNet Anaconda environment activated and jump to the location: “D:\mxnet\python”. Once you are in the correct location, run

If it ran without any errors, then we are ready to do our final test. Go back to the terminal where you acivated mxnet environment and first, start Python interpreter, and then run

You should be able to import the library.

Enjoy!

 

Python NLTK module and its download() function

I am trying to build a small machine learning service that would use Python NLTK library. As it is a pet project, and a very small one – I’ve decided to use Heroku for the hosting. And as I am using NLTK library I needed to download models and corpora by calling nltk.download() method to parse punctuation and have some other textual tricks.

Heroku doesn’t allow that method to execute, as it requires GUI interaction.

Initially I got a bit lost, as there is a way to bypass GUI when you provide specific list of NLTK corpora to download – but for certain missing models the error message provided a name of a model that was not compatible with nltl.download().

Luckily, I’ve found the page with a list of all available corpora and associated download IDs.

http://www.nltk.org/nltk_data/

Enjoy.

RE7 – Biohazard

I want to congratulate all the fans of the series. Finally there is an episode that has an old house.

An episode with puzzles in an old house. Also, an episode where you have to save bullets when you trying to kill these very, very scary mutations and family members.

I am loving the gameplay, but can not play it alone, I get scared. A true horror game as it should be. I am playing with my mom, who is about to finish the game on her own. We both are fascinated with the visuals of the game that are pushing the boundaries of what our old PS4 could deliver. Truly beautiful and scary.

I am happy there will be new episodes coming in later as DLCs. Not a big fan of the DLC concept, but I will make an exception.

A strong return in my opinion.

Ideology

Ideology – is a system where other people can wreck your life.

https://en.wikipedia.org/wiki/Ernst_Kolman

Generators in Python!

Python generators code tutorial:

UUID3 cross compatible in Java and Python

Sometimes, in the world of microservices you want to generate consistent hashes across several languages. I’ve faced a problem of getting the same UUID in Java and Python, and wanted to share how it can be done.

Java

Python

Enjoy!

PyMongo insert_many with overwrite

I’ve recently needed to insert lots of objects into the Mongo collection. The only problem was that some of the objects would have an ‘_id’ key pre-set and would conflict with existing objects in the database.

PyMongo inser_many operation doesn’t support it out of the box, so here is a work-around using bulk api:

Keep H1B

Just a short point. Conservatives talk about H1B visas being used to bring workforce that doesn’t really match the criteria that is defined in the H1B terms. It is possible, and I agree sometimes it happens.

But you need to understand that the cancelling H1B will just mean that the companies will switch to a remote, online workforce. No options for taxation and the money paid to a person will not fall into the pocket of a local hotel, grocery store or a barber.

You can not protect technology jobs inside the US by not letting people in to the country. People will just work remotely. The possibility for remote work is available for designers, engineers and basically anyone who uses computer to produce some unit of work.

Wake up.

 

 

Migration of tolerance.

Feels like very soon we will have people starting to migrate from intolerant places to the somewhat tolerant West Coast.

Online classes are fun.

There are abundance of universities and online educational portals. How to choose, how to spend your time and money on a learning opportunity? What to do???

Not talking about hands-on medical experience, but the majority of scientific subjects, from biology to discrete mathematics, are often equally useful and available both online and offline.

The online classes would usually give you some sort of a certificate, to tickle your ego. A university generally gives you a transferable credit that later you can use for a degree. Both verifications can be useful, but often not.

I’ve been taking various classes across online portals, community colleges and universities for the past several years. So far what I can point is a few challenges and bureaucratic differences that might help you decide what is the best way for you to learn something. All the below is a bit of a well-behaved generalization, that I find quite accurate.

Most of the time, a college class is somewhat a contract between a student and teacher. At least this is how I see it.

Teacher agrees to give interesting and vitalizing lectures, quizzes and assignments.

Student agrees to pay attention, get excited and do her (his) shit.

My offline experience so far is not that great, especially when it is related to a formal credit hunting:

  1. Teacher doesn’t agree to anything, and naturally gives lectures, quizzes and assignments. If the teacher is bored a student could forget about anything vitalizing or interesting. Just memorize your slides, right.
  2. If you happen to take a class in Russia, you are fucked trapped in the class as there is no option to change the teacher when you are enrolled in a formal, well established degree.
  3. There is also no option to change the class.
  4. If you happen to take a class in the United States, you are also fucked trapped. You have an option to change the teacher, but often there are no other teachers available for the next hundred semesters.
  5. So nothing makes sense but there is a test and a final exam so you just shut up and study.

THUMBS UP.

All in all – sad, boring and depressing. You pay money, play the lottery with the class and the lottery is in no way in your favor.

One can get skeptical. But not really, if you start looking at online education. Not a B.S. M.S. stuff, but a class by class education, with a certificate or some sort of acknowledgment that you were enrolled, did your shit and passed some quality control.

And here is a list of places where you can find these classes, with a few notes on each place.

  1. https://www.coursera.org/ – Amazing, awesome and great. I love this website. If I ever decide to study till I am 100 years old, it just the place where I can do it. It has the most comprehensive set of classes from various colleges in various languages.
    1. Free enrollment is available for the majority of classes. You attend and do the homework, but won’t get a certificate.
    2. Pay for the certificate and you can publish it on your LinkedIn profile and be cool and all.
    3. Get into a ‘Specialization’ and complete a sequence of classes. This is really great as it extends the scope of a single class and you are basically getting a mini degree in some field.
  2. https://www.edx.org/ – Almost as good as Coursera. When comparing the two It comes down to personal preference and the availability of the classes.
    1. You can audit a class for free.
    2. You can get a certificate for a fee.
    3. Classes are presented by major universities or companies.
    4. You can get a micro-masters, which can be converted into units and transferred to the particular M.S. in the university who presented the online degree. I really like this idea and find it tempting to enroll in an AI micro-masters. Maybe next year.
  3. https://www.udacity.com/ – This is a place where you can learn programming.  I am serious – you can learn all the computer science software engineering jazz from A to Z on this beautiful MOOC.

There are several more portals, but I guess if you are comfortable with English and want to learn a specific topic outside of an offline college – take a look at these three titans.

You are doing yourself a favor trying a class online – you can find something interesting and vitalizing, and actually invest your brain power in a study because you like the class. Peace.

GLHF!

 

© 2018 Movies, and engineering. . All rights reserved.

Theme by Anders Norén.