Below are the solutions to these exercises on optimization algorithms in Tensorflow. #################### # # # Exercise 1 # # # #################### library(caret) ## Warning: Installed Rcpp (0.12.14.5) different from Rcpp used to build dplyr (0.12.11). ## Please reinstall dplyr to avoid random crashes or undefined behavior. x = as.matrix(mtcars$qsec) y = as.matrix(mtcars$vs) trainIndex = […]

## Tensorflow – Neural Network Training: Exercises

Deep learning is under active development. Papers with new approaches are being published every day. In this set of exercises we will go through some of the newer methods that boost the neural network’s performance. By the end of this post, you will be able to train neural networks with adaptive learning rates and apply […]

## Tensorflow – Logistic Regression: Exercises

In this set of exercises, we will go through the basics of logistic regression analysis using [Tensorflow](https://www.tensorflow.org/). By the end of this post, you will be able to perform classification analysis with linearly separable data. We recommended to check out the (tutorial)[https://www.r-exercises.com/2018/03/04/logistic-regression-in-tensorflow] before you start solving these exercises. We will use the ‘mtcars’ built-in data-set. […]

## Tensorflow – Logistic Regression: Solutions

Below are the solutions to these exercises on “Tensorflow – Logic Regression.” #################### # # # Exercise 1 # # # #################### library(caret) ## Warning: Installed Rcpp (0.12.14.5) different from Rcpp used to build dplyr (0.12.11). ## Please reinstall dplyr to avoid random crashes or undefined behavior. x = as.matrix(mtcars$qsec) y = as.matrix(mtcars$vs) trainIndex = […]

## Logistic Regression in Tensorflow

What is Logistic Regression? Logistic regression seeks to: Model the probability of an event occurring, depending on the values of the independent variables, which can be categorical or numerical. Estimate the probability that an event occurs for a randomly selected observation versus the probability that the event does not occur. Predict the effect of a […]

## Tensorflow – Linear Regression: Exercises

In this set of exercises, we will go through the basics of Regression Analysis Using [Tensorflow](https://www.tensorflow.org/). By the end of this post, you will be able to perform regression analysis with linearly separable data. It is recommended to check out the (tutorial)[Click here] before starting the exercises. We will use the ‘mtcars’ built-in data-set. Before […]

## Tensorflow – Linear Regression: Solutions

Below are the solutions to these exercises on “Data Transformation.” #################### # # # Exercise 1 # # # #################### X = tf$placeholder(tf$float32, name = “X”) Y = tf$placeholder(tf$float32, name = “Y”) #################### # # # Exercise 2 # # # #################### W = tf$Variable(0.0, name = “weights”) b = tf$Variable(0.0, name = “bias”) init_op […]

## Linear Regression in Tensorflow

Linear Regression Theory Overview In statistics, linear regression is a linear approach for modeling the relationship between a scalar dependent variable, “y”, and one or more explanatory (independent) variables. The case of one independent variable is called simple linear regression. For more than one independent variable, the process is called “multiple linear regression.” The compacted […]

## Tensorflow – Basics Part 2: Exercises (2/2)

Tensorflow is an open source, software library for numerical computation using data flow graphs. Nodes in the graph are called ops (short for operations), while the graph edges represent the R multi-dimensional data arrays (tensors) communicated between them. An op takes zero or more Tensors, performs some computation, and produces zero or more Tensors. In […]

## Tensorflow – Basics Part 2: Solutions (2/2)

Below are the solutions to these exercises on Tensorflow Basics. #################### # # # Exercise 1 # # # #################### input_1 <- tf$placeholder(tf$float32, name=’input_1′) input_2 <- tf$placeholder(tf$float32, name=’input_2′) #################### # # # Exercise 2 # # # #################### with(tf$Session() %as% sess, { print(sess$run(c(input_1, input_2), feed_dict=dict(input_1 = 7.0, input_2 = 2.0))) }) ## [[1]] ## [1] […]