Torch / Lua / ugly summation: I don’t know anything about Lua, and that kind of packs sand in my bearings instead of grease. We’re still talking about a library that is geared toward computation heavy work. As much as I like the idea of community supported projects, they never quite feel as polished as something with a corporate logo floating - if silently - in the background. I would show some code using Torch, but it’s definitely different enough that I’m not comfortable digging into it enough to find some bit of code that makes sense to me. Not that it’s too dense for me to do that. I just feel like I would be wasting time on something I have no plans to dig into.
Theano / Python / ugly summation: It’s a Python library that takes complicated computations and gives them to the CPU or GPU in a more efficient language. It is still about tensors and sounds a little like TensorFlow to me. Even the code kind of looks familar, due to being written in Python of course, but also because a library is being invoked to go do math. Theano feels at this point less, I don’t want to say developed, but TensorFlow 1.0 certainly seems to have more going for it at the moment. Torch / Lua / ugly summation: I don’t know anything about Lua, and that kind of packs sand in my bearings instead of grease. We’re still talking about a library that is geared toward computation heavy work. As much as I like the idea of community supported projects, they never quite feel as polished as something with a corporate logo floating - if silently - in the background. I would show some code using Torch, but it’s definitely different enough that I’m not comfortable digging into it enough to find some bit of code that makes sense to me. Not that it’s too dense for me to do that. I just feel like I would be wasting time on something I have no plans to dig into. For now, TensorFlow beat out PyBrain early on, and although Theano remains in the Python arena, I feel like I’ve already made some progress on learning about TensorFlow. Stopping at this point to learn about Theano would be giving in to some attention deficit and I’d rather avoid that. I certainly haven’t become even a beginning moderate expert at TensorFlow, I just think I’m satisfied that it’s a solid direction. Torch, I’m sure is a great library and is supported by a wonderful community, but again, I’m planting my feet on TensorFlow and will delve into learning about making it more accurate at identifying handwritten digits.
Problem Statement: Automating test scripts is a task that strips away the time of the Test engineer. If a machine can be trained to navigate a website following steps, then the engineer can regain the time spent creating specific scripts for every test.
Another Question UX/UI: Is it possible to generate a model of a website’s design that ML could consume to be able to navigate that site? Let’s assume that a machine can be taught to understand the elements of a website. I still have to get it to interact with the website. While thinking about this aspect of my problem, I remember, there was a machine that was taught to play video games. After a quick search on the web, I found TensorKart and started reading. The creator of that system created an input plugin using C, which is really something I don’t want to and probably can’t do efficiently. I am hoping to find some kind of library to bypass that since I’m not talking about something as niche as sending commands to a game console emulator. Because of my experience with Selenium WebDriver, I thought about it as an interface, but that doesn’t immediately present itself as a workable solution. I don't want to have to create page objects because that's exactly the work I want to give the computer. How to make a computer think it’s receiving input from a mouse and keyboard should not be a difficult problem to overcome, but no experience in this area leaves me with too many unknowns to make any bold statements about how I will accomplish this part of my project. Research turns up a book in my library that I’ve ignored for a little while: Automate the Boring Stuff by Al Sweigart. In Chapter 18, the intro makes me pretty excited about the potential future of my machine learning automated testing project. Knowing that GUI Automation is a thing (keeping in mind that I knew Selenium WebDriver was a thing), and that there are modules for Python (again proving that Python is a broad language with many applications)...Well, I’m just excited to get started. I also really need to get more understanding of feeding data into the machine for actual use beyond testing. In the code I copied and ran previously, it prints out the assessment of how the net faired at identifying the test data. There are more levels to testing software than identifying what a piece of data is or is not. In my project, I propose to have a machine that can navigate a web page based on a simple set of instructions a human could follow. I also propose to have that machine assess the condition of the page based on its interactions with it. Finally, it has to decide if that set of interactions and assessments meet a criteria it has been given and report on those assessments. I don’t believe this is impossible, but I am starting to see that this is far more complicated than most of the A.I. projects that sit in the public eye. What follows is a recounting of my experience with the TensorFlow MNIST for ML Beginners. I took the path of copying the code in the mnist_softmax.py file and running it. $ python /Users/me/Documents/Python/tfbegin.py Successfully downloaded train-images-idx3-ubyte.gz 9912422 bytes. Extracting /tmp/tensorflow/mnist/input_data/train-images-idx3-ubyte.gz Successfully downloaded train-labels-idx1-ubyte.gz 28881 bytes. Extracting /tmp/tensorflow/mnist/input_data/train-labels-idx1-ubyte.gz Successfully downloaded t10k-images-idx3-ubyte.gz 1648877 bytes. Extracting /tmp/tensorflow/mnist/input_data/t10k-images-idx3-ubyte.gz Successfully downloaded t10k-labels-idx1-ubyte.gz 4542 bytes. Extracting /tmp/tensorflow/mnist/input_data/t10k-labels-idx1-ubyte.gz 0.9147 The result is a decimal that pops out, and to the uninitiated like me, this is so not impressive. I'm reliving all those times I opened a book on C or C++, pecked in the Hello World example and thought to myself..."That's it?" And yeah...that's it. Just this 0.9147 or shy of 92% if you want to think of it as a grade. Except, in machine learning a 92% is a total dunce. Not that I'm qualified to say it, but as the tutorial points out, this is a pretty simplistic model and a refinement of the model could yield results at the 99.7% mark.
So what's going on in the code? The high level view is:
If I'm not focused on the distracting stuff, what does have my attention? I know about importing libraries, and I get the idea of the MNIST data, so my first stop is the model definition. What is going on in that section of code?
Okay, I'm confused a bit because I kind of think of variables as placeholders, so I need a new way to think of variables if they're different from placeholders - which they clearly are in TensorFlow. In TensorFlow, a placeholder allows for the data to be fed into the placeholder at execution. "While you can replace any Tensor with feed data, including variables and constants, the best practice is to use a placeholder op node". That means that placeholders have a very specific purpose particularly in relation to variables and constants which can also be fed, though they shouldn't be fed. What is a variable in TensorFlow anyway? Well, unlike the placeholder, a variable is initialized with a value as opposed to having that value fed to it later. It's easier to see what happens to the placeholder 'x' later during the training and testing of the model. When the training phase of the program executes it feeds data in the 'x' as well as the 'y_' placeholders. Obviously a little more is going on, I plan to read more about this cross_entropy section of the tutorial, but this was interesting. Far more going on than in a simple Hello World application you might write when learning a new language. Speaking of learning a new language, I find it exceptionally helpful that TensorFlow and Python work so well out of the box. |
Disclaimer: The opinions expressed herein are my own. I do not represent my employer, coworkers, mentor, friends, or family in any way on this website or any of its connected social media accounts.
Categories
All
Archives
September 2021
|