Please, read my previous post about Swift & TensorFlow

MNIST

I took “Hello World!”  in the universe of neural networks as an example, a task for systematization of MNIST images. MNIST dataset includes thousands of images of handwritten numbers, the size of each image is 28×28 pixels. So, we have ten classes that are neatly divided into 60 000 images for educating and 10 000 images for testing. Our task is to create a neural network that is able to classify an image and determine the class it belongs to (out of 10 classes).

Read More

I think it is not necessary to explain the meaning of such terms as machine learning and artificial intelligence in 2017. You can find a lot of op-ed articles and research papers on this topic. So, I assume that the reader is familiar with the topic and knows definitions of basic terms. When talking about machine learning, data scientists and software engineers usually mean deep neural networks that became quite popular because of their productivity. So far there are many software solutions and packages for solving artificial neural networks tasks: Caffe, TensorFlow, Torch, Theano(rip), cuDNN, etc.

Swift

Swift is an innovative protocol-oriented open source programming language written within Apple by Chris Lattner (who recently left Apple and, after SpaceX, settled down in Google).
Apple OS already features different libraries for working with matrices and vector algebra, such as BLAS, BNNS, DSP, that were later on gathered in the single Accelerate library.
In 2015, small-scale solutions based on the Metal graphics technology for implementing math appeared.
In 2016, CoreML was introduced:

CoreML

CoreML can import a finished and trained model (CaffeV1, Keras, scikit-learn) and allows developer to export it to an application.
So, in the first place, you need to prepare a model on another platform using the Python or C++ language and third-party frameworks. Second, you need to educate it using a third-party hardware based solution.
Only after that you can import it and start working with the Swift language. As for me, it all seems too complicated.

Read More

Today TensorFlowKit package is available for open-source community.

TensorFlowKit is an Octadero Swift Package which allows developers to simply and easily integrate TensorFlow machine learning models into apps running on macOS and Ubuntu OS.

API based on TensorFlow library.

  • System modules:
    • CTensorFlow is C API system module;
    • CCTensorFlow is C++ API system module;
    • CProtobuf is protobuf library system module;
  • Low-level:
    • CAPI – Swift writen low-level API to C library;
    • CCAPI – Swift writen low-level API to C+ library;
    • Proto – Swift auto – generated classes for TensorFlow structures and models;
  • Helper tool:
    • OpPruducer – Swift writen command line tool to produce new TensorFlow Operations
  • High-level:

 

TensorFlowKit architecture.

 

All documentation available by links bellow:

  • CAPI – Swift writen low-level API to C library;
  • Proto – Swift auto – generated classes for TensorFlow structures and models;
  • OpPruducer – Swift writen command line tool to produce new TensorFlow Operations
  • TensorFlowKit – Swift writen high-level API;

Sources at: GitHub

 

You should know, that TensorFlow written on C++ as core (backend) and Python as frontend languages.

Python was the first client language supported by TensorFlow and currently supports the most features. More and more of that functionality is being moved into the core of TensorFlow (implemented in C++) and exposed via a C API.

If you are working with TensorFlow not only as Python software engineer, from time to time you should use C++ environment and available code, in your work. Sometimes you need to clarify C API, sometimes use it to port Python available code to other language. Any way you have to have build – ready C++ code on your computer.

How you can prepare it?

You need build it from sources. There is short guide:

Read More

Kraken as height level API for TensorFlow.

Since today Kraken is high – level API and brain system for the most powerful deep – learning framework TensorFlow.

TensorFlow is the fastest growing solution for neural networks. Written on C++ language it shows huge performance on CPU and GPU hardware. Kraken could help us to build deep learning architecture at real time and test them in different ways and on different servers.

Using TensorFlow library as core of our Neural Network you can get lot’s of benefits as:

  • Many dimansion Pooling layer;
  • Many dimansion Normalization layer;
  • Many dimansion Convolution layer;
  • Densely-connected layer;
  • Many dimansion Pooling layer;
  • RNN and LSTM solutions;
  • Optimizer;

From today our tool is incredible powerful and strong.