Skip to main content

Posts

CNN Input shape for Deep Learning Frameworks

In Deep learning use cases images are represented as 3-D tensors (for colored images) and 2-D tensors (for gray scale images). Images mainly have three attributes: height, width, channels . Different deep learning frameworks expect these attributes to be specified in different order as per respective frameworks. In this post we are going to discuss the formats in which popular deep learning frameworks expect these attributes to be specified. Currently there are many deep learning frameworks in the market like:   1. Keras (for Python): Keras is a deep learning framework for Python. Keras is a wrapper around numerical computing libraries to provide user an easy interface to code Deep Learning networks. As a backend Keras could use:     a. Tensorflow     b. Theano 2. DL4J (for Java/Scala): DL4J is a deep learning framework written in Java. It could be used with Java as well scala programming languages.
Recent posts

Accessing R script from Java

R is powerful language for statistical analysis and Machine Learning. Java is best suited to develop enterprise applications. Integrating both could lead to developing powerful analytic applications. In this tutorial we are going to call a R script from java, then pass the parameters from java to R and fetch back the results from R to Java. Problem Statement: In this tutorial we have a csv file 'data.csv' having 4 columns and we need to calculate mean of few user defined columns. To calculate the mean we will be using and then we will pass the calculated mean back to Java. Pre-requisites:  1. You should know how to integrate R with Java. For that you could consult the tutorial http://rajeev0401.blogspot.in/2013/10/using-r-programming-language-inside-java.html Code Files: We will be needing following files: 1. data.csv: file having data that will be used in R script. 2. config.R: this file contains the configuration (vector having column index) to be used in 'test

Configuring SSL in MongoDB on Windows Platform

Hi, Recently I had a situation where in I was required to create a secure connection between mongodb server (mongod) and mongodb client (mongo). In order to establish the secure connection there is a need to start Mongodb in the following manner: mongod --sslOnNormalPorts --sslPEMKeyFile <Location of PEM file of mongod> If the above command is run is run on the free version of Mongodb then following error is generated: error command line: unknown option sslOnNormalPorts use --help for help The main cause of this error is due to the fact that the normal free version of Mongodb does not support SSL functionality by default. In order to use SSL functionality following two methods could be used: 1.     Build Mongodb from its source using SSL option. 2.     Use Enterprise version of mongodb. If you a looking forward to use the Enterprise version then there is no need to worry about SSL as this option will be by default present in the Enterprise v

Using R Programming Language inside Java

Hi, This tutorial walks you through using R programming language inside a java program. R is a powerful programming language for Machine Learning and Data Mining. It contains implementation of various Machine Learning algorithms. Recently i had a situation where i was supposed to use these machine learning algorithms inside my java program. I searched the web but the stuff i found was not of much help. Thus i thought of putting the same in the form of this tutorial. This tutorial is not intended to teach you R language. It is only to help you integrate R to Java and then to use R functions inside a Java program. Pre-requisite: Following things are needed to be pre-configured on your system to use R in Java program: 1. R workbench:  R has got a console known as RGui where R commands/programs could be executed. To install RGui simply go to  http://cran.r-project.org/bin/windows/base/  and download the ' Download R 3.0.2 for Windows   (52 megabytes, 32/64 bit) '. Simply

Creating a Struts-2 hello world application on eclipse

Hi, This is a getting started tutorial for struts-2. Struts-2 is similar to struts-1 but there are certain changes in terms of functionality and syntax. The main components needed to create the demo application are as follows: 1. Eclipse indigo. 2. Struts-2 distribution:- To download struts-2 distribution go to 'http://struts.apache.org/download.cgi#struts238-SNAPSHOT' and download 'Full Distribution: struts-2.3.7-all.zip (76mb) [ PGP ] [ MD5 ] ' 3. Tomcat 7. That is all you need to create a struts application. Application Structure: The demo application that we are going to create using struts-2 is a login application. The application will be having following components: 1. index.jsp 2. HelloWorld.jsp 3. error.jsp 4. HelloWorldAction.java Now the application proceeds as follows: 1. When the application starts the user is presented with 'index.jsp' where the user enters username and password. 2. On submitting the 'index.jsp' page

Uploading a binary file to RESTful web service in java using Jersey

Hi, Recently I had a situation where I was supposed to upload a binary file to a server side RESTful web service created in Jersey. I faced a lot of trouble in doing so because always one or the other part of the hood was not working properly. The following post gives a step by step process as how to create a RESTful service that accepts uploaded binary files. Pre-requisites: 1. A running RESTful service based on Jersey. 2. An HTML page with file upload component. 3. Tomcat 7 as web server. 4. Eclipse indigo. Note: Let us suppose that tomcat is running on same machine on which the HTML client is present. So we will be using the base domain URL as ' http://localhost:8080/ '. If your service and client are located on different instances of tomcat then replace the localhost part of the URL with the IP address of the machine on which the REST service is running. Step 1 (Eclipse setup): a. Create a 'Dynamic Web Project' in eclipse indigo. Let us say that thi