Week 09: In-Class Assignment:
Tensorflow and TensorBoard#
✅ Put your name here.#
✅ Put your group member names here.
This week we are done with sklearn
!! Here we come TensorFlow!
Actually, this isn’t really true. Always keep in mind that sklearn
has an incredible number of tools that are part of the EDA and postprocessing steps. No matter which library you use for your estimator, the amazing tools in sklearn
are there for your pre- and post-processing steps. You don’t need to work only within one software ecosystem.
First Steps#
The first thing you need to do is get familiar with tensforflow (TF) and install it on your computer.
got to this webpage; while you are there, poke around so that you know where to find things,
next, here is where you can intall TF
One difference you will notice, in comparison to sklearn
is that TF really has a focus on deep learning. You aren’t going to find the blizzard of different ML methods in TF. In a sense, it does one thing and it does that one thing very well.
The first question you are likely to have is: what is a tensor?! You might even panic because that was an obscure concept in math that you never really learned. Don’t panic! You alaredy know what a tensor is: it is just a multidimensional Numpy array. As we saw with sklearn
, the data is packaged in a Numpy array where it can be rapidly processing through the ML libraries. What is powerful about this is that the software can be made to be very fast with this data structure; moreover, even the hardware can be adapted to rapid tensor processing.
TF works very well with Google Colab. You may or may not have access to Colab through MSU. If you want to use Colab with TF you have two choices:
get into Colab through a non-MSU account,
request acess to Colab through MSU; this can take a couple of weeks.
ICA: Your Pick!#
Ok, so what are your options for today’s ICA?
on this page on the left panel click on “ML Basics with Keras” under “Beginner”.
in the left column there is a list: click on each of them and discuss them with your group; be sure to click on “More example on keras.io” because there are lots of examples under that link,
for example, if your group is doing projects with images, you might look for a convnet; conversely, if you want something safe and familiar, choose “Basic image classification”,
perhaps most interesting would be to simply choose a topic you want to learn about, such as sentiment analysis,
once you choose something, note that you can run it immediately in Colab (if you have access to that) or you can download the notebook: having this starting point makes it easy that you can finish during class,
see if you can get tensorboard working: read your text at p. 340 (3rd edition, p.317 for 2nd edition) and look here – use your group wisely: you have enough people that one person could lead the tensorboard component.
Today’s ICA is very open ended. I threw out my original plan and came up with something that allows your group to explore something you are interested in. Here is what you need to do today:
you will choose your TF project: discuss the options within your group, and settle on what is most interesting to you (in fact, if your group is large enough and there are two topics of interest, split your group into two)
there are two things I want you to learn today:
how to find TF content and teach yourself how to use it,
learn the basic TF commands.
What you will turn is a notebook you will create with your group that contains a working TF code. At the top, where it is easy to find:
who is in your group (this is more important than usual if you break into two subgroups),
list all of the TF commands you used with an explanation of what they do,
which project did you chose and why? what did you found interesting about it?,
give a summary of the logic of how TF works,
what your ML did (was this an autoencoder, standard ANN? what was the ML goal, etc.)
discuss how your group members might use TF for their projects; does TF offer advantages to, or over,
sklearn
for your projects?
The “logic” of a software package is sometimes referred to as the “API”, which is the logic of how things are connected and work together. Just like with sklearn
, once you know TF’s API, it will be very easy to use.
© Copyright 2023, Department of Computational Mathematics, Science and Engineering at Michigan State University.