I have searched many places but ALL I get is HOW to install it, not how to verify that it is installed. I can verify my NVIDIA driver is installed, and that CUDA is installed, but... moreI have searched many places but ALL I get is HOW to install it, not how to verify that it is installed. I can verify my NVIDIA driver is installed, and that CUDA is installed, but I don't know how to verify CuDNN is installed. Help will be much appreciated, thanks!
PS.This is for a caffe implementation. Currently everything is working without CuDNN enabled.
I've just trained an LSTM language model using pytorch. The main body of the class is this:
class LM(nn.Module): def __init__(self, n_vocab, seq_size, embedding_size, lstm_size,... moreI've just trained an LSTM language model using pytorch. The main body of the class is this:
class LM(nn.Module): def __init__(self, n_vocab, seq_size, embedding_size, lstm_size, pretrained_embed): super(LM, self).__init__() self.seq_size = seq_size self.lstm_size = lstm_size self.embedding = nn.Embedding.from_pretrained(pretrained_embed, freeze = True) self.lstm = nn.LSTM(embedding_size, lstm_size, batch_first=True) self.fc = nn.Linear(lstm_size, n_vocab) def forward(self, x, prev_state): embed = self.embedding(x) output, state = self.lstm(embed, prev_state) logits = self.fc(output) return logits, state
Now I want to write a function which calculates how good a sentence is, based on the trained language model (some score like perplexity, etc.).
I'm a bit confused and I don't know how should I calculate this.A similar sample would be of greate use. less
I have a neural network written in PyTorch, that outputs some Tensor a on GPU. I would like to continue processing a with a highly efficient TensorFlow layer.
As far as I... moreI have a neural network written in PyTorch, that outputs some Tensor a on GPU. I would like to continue processing a with a highly efficient TensorFlow layer.
As far as I know, the only way to do this is to move a from GPU memory to CPU memory, convert to numpy, and then feed that into TensorFlow. A simplified example:
import torch import tensorflow as tf # output of some neural network written in PyTorch a = torch.ones((10, 10), dtype=torch.float32).cuda() # move to CPU / pinned memory c = a.to('cpu', non_blocking=True) # setup TensorFlow stuff (only needs to happen once) sess = tf.Session() c_ph = tf.placeholder(tf.float32, shape=c.shape) c_mean = tf.reduce_mean(c_ph) # run TensorFlow print(sess.run(c_mean, feed_dict={c_ph: c.numpy()}))
This is a bit far fetched maybe but is there a way to make it so that either
a never leaves GPU memory, or
a goes from GPU memory to Pinned Memory to GPU memory.
I attempted 2. in the code snipped above using non_blocking=True but I am not sure if it... less
I'm a bit confused by the cross entropy loss in PyTorch.
Considering this example:
import torch
import torch.nn as... moreI'm a bit confused by the cross entropy loss in PyTorch.
Considering this example:
import torch
import torch.nn as nn
from torch.autograd import Variable
criterion = nn.CrossEntropyLoss()
loss = criterion(output, target)
print(loss)
I would expect the loss to be 0. But I get:
Variable containing:
0.7437
As far as I know cross entropy can be calculated like this:
But shouldn't be the result then 1*log(1) = 0 ?
I tried different inputs like one-hot encodings, but this doesn't work at all, so it seems the input shape of the loss function is okay.
I would be really grateful if someone could help me out and tell me where my mistake is.
Thanks in advance! less
When it comes to installing Tensorflow, I've tried each of the installation suggestions on this page.
https://www.tensorflow.org/install/install_mac
-Pip +... moreWhen it comes to installing Tensorflow, I've tried each of the installation suggestions on this page.
https://www.tensorflow.org/install/install_mac
-Pip + Pip3
-virtualenv
-With Docker
The only installation method that I was unable to apply was Conda. My default environment for Data Science is Spyder launched from Anaconda_Navigator. However, I am unable to get the Conda command to work, in any form, from the command line.
My goal is to get tensor flow working from the iPython console from with in Spyder.
I am trying to run the suggested validation code:
# Python
import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))
Here is the information on my iPython installation:
Python 3.6.1 |Anaconda 4.4.0 (x86_64)| (default, May 11 2017, 13:04:09)
Type "copyright", "credits" or "license" for more information.
IPython 5.3.0 -- An enhanced Interactive Python.
The first line of code throws the following error.
ModuleNotFoundError: No module named... less
I want to get a list of the column headers from a Pandas DataFrame. The DataFrame will come from user input, so I won't know how many columns there will be or what they will be... moreI want to get a list of the column headers from a Pandas DataFrame. The DataFrame will come from user input, so I won't know how many columns there will be or what they will be called.
For example, if I'm given a DataFrame like this:
>>> my_dataframe y gdp cap 0 1 2 5 1 2 3 9 2 8 7 2 3 3 4 7 4 6 7 7 5 4 8 3 6 8 2 8 7 9 9 10 8 6 6 4 9 10 10 7
I would get a list like this:
>>> header_list
I cannot find any resources about wether one of the following three methods for getting a list of column names is preferred over the others. The first and simplest, seems to work... moreI cannot find any resources about wether one of the following three methods for getting a list of column names is preferred over the others. The first and simplest, seems to work with my current example. Is there any reason I should not use it ?
>>> import pandas as pd >>> import numpy as np >>> df = pd.DataFrame(np.random.rand(5,3)) >>> df.columns RangeIndex(start=0, stop=3, step=1) >>> list(df.columns) >>> df.columns.get_values().tolist() >>> list(df.columns.get_values())
Update
Performance - related answer here: https://stackoverflow.com/a/27236748/605328 less
I'm learning about artificial neural networks and have implemented a standard feed-forward net with a couple hidden layers. Now, I'm trying to understand how a recurrent neural network(RNN) works in practice, and am having trouble with how activation/propagation flows through the network.
In my feed-forward, the activation is a simple layer by layer firing of the neurons. In a recurrent net, the neurons connect back to previous layers and sometimes themselves, so the way to propagate the network must be different. Trouble is, I can't seem to find an explanation of exactly how the propagation happens.
How might it occur say for a network like this:
Input1 --->Neuron A1 ---------> Neuron B1 ---------------------> Output
^ ^ ^ |
| | --------
| |
Input2 --->Neuron A2 ---------> Neuron B2
I imagined it would be a rolling activation with a gradual die down as... less
I am learning about Neural Networks and back-propagation. I think I understand how the network works, in terms of input, output, hidden layers, weights, bias etc However, I still... moreI am learning about Neural Networks and back-propagation. I think I understand how the network works, in terms of input, output, hidden layers, weights, bias etc However, I still don't fully understand how to design a network to fit a problem. Ie: Say I wanted a neural net to learn how to play Draughts, how would I translate the problem into a neural net design? Cheers :)
Is there a Pytorch-internal procedure to detect NaNs in Tensors? Tensorflow has the tf.is_nan and the tf.check_numerics operations ... Does Pytorch have something similar,... moreIs there a Pytorch-internal procedure to detect NaNs in Tensors? Tensorflow has the tf.is_nan and the tf.check_numerics operations ... Does Pytorch have something similar, somewhere? I could not find something like this in the docs...I am looking specifically for a Pytorch internal routine, since I would like this to happen on the GPU as well as on the CPU. This excludes numpy - based solutions (like np.isnan(sometensor.numpy()).any()) .
I am trying my hands at grabbing data from an API in R.
The API I am using is the Data Science Toolkit's street2coordinates.
Basically this API returns the coordinates for street... moreI am trying my hands at grabbing data from an API in R.
The API I am using is the Data Science Toolkit's street2coordinates.
Basically this API returns the coordinates for street addresses. I tried using it and it works fine when I pass just one address. Like This:
library(httr)
I am not sure how to pass multiple addresses to this function.
I tried doing this but the output is something I don't understand. It's a weird list.
addresses <- c("4600 Vegas Dr, Las Vegas, NV 89108","3600 Vegas Dr, Las Vegas, NV 89108")
url <- GET("http://www.datasciencetoolkit.org/street2coordinates/addresses")
Long story short, I am looking for a way to pass more than one address in the GET function. Is there a way to do this?
I'm new to big data processing and I'm reading about tools for stream processing and building data pipelines. I found Apache Spark and Spring Cloud Data Flow. I want to know the... moreI'm new to big data processing and I'm reading about tools for stream processing and building data pipelines. I found Apache Spark and Spring Cloud Data Flow. I want to know the main differences and the pros and cons of them. Could anybody help me?
I've been using gsub("toreplace","replacement", myvector) to clean out data in R. While this works for commas and the like, removing "$" has no effect. So if I do... moreI've been using gsub("toreplace","replacement", myvector) to clean out data in R. While this works for commas and the like, removing "$" has no effect. So if I do gsub("$","",myvector) all the dollar signs remain in place.I think this is because $ is a special character in R. I tried escaping it "\$" but that yields the same result (no effect). And I couldn't find a resource on escaping special characters in R.Obviously I should do this in preprocessing. But I was wondering if anyone out there knew how to either a) escape special characters in R b) get rid of pesky $ in R directly. For science. less
There's various activation functions: sigmoid, tanh, etc. And there's also a few initializer functions: Nguyen and Widrow, random, normalized, constant, zero, etc. So do these... moreThere's various activation functions: sigmoid, tanh, etc. And there's also a few initializer functions: Nguyen and Widrow, random, normalized, constant, zero, etc. So do these have much effect on the outcome of a neural network specialising in face detection? Right now I'm using the Tanh activation function and just randomising all the weights from -0.5 to 0.5. I have no idea if this is the best approach though, and with 4 hours to train the network each time, I'd rather ask on here than experiment!
I really need help implementing a continuous tanh-sigmoid activation function in a very basic neural network. If you could give a basic example that would be great, but if you... moreI really need help implementing a continuous tanh-sigmoid activation function in a very basic neural network. If you could give a basic example that would be great, but if you could change it in my source code I would be extremely grateful! Also, what range should the random weights be initiated with (i.e. what range)?
Assume df1 and df2 are two DataFrames in Apache Spark, computed using two different mechanisms, e.g., Spark SQL vs. the Scala/Java/Python API.Is there an idiomatic way to... moreAssume df1 and df2 are two DataFrames in Apache Spark, computed using two different mechanisms, e.g., Spark SQL vs. the Scala/Java/Python API.Is there an idiomatic way to determine whether the two data frames are equivalent (equal, isomorphic), where equivalence is determined by the data (column names and column values for each row) being identical save for the ordering of rows & columns?The motivation for the question is that there are often many ways to compute some big data result, each with its own trade-offs. As one explores these trade-offs, it is important to maintain correctness and hence the need to check for the equivalence/equality on a meaningful test data set. less
So I have created an xaml flow which clicks browser buttons downloads files and then does some basic operations. I setup a windows server and connected remotely to it and when I... moreSo I have created an xaml flow which clicks browser buttons downloads files and then does some basic operations. I setup a windows server and connected remotely to it and when I debug my process automation while staying on the screen it works smoothly, problem is that I can't keep my pc on forever so when I just minimize the file even though my system remains up and running: The UI Path process kills as the button press times out. I was just curious to know if it's compulsory to keep screen up for the ui based process automation to run through or is there a way to initiate the process and then close the screen and let the system do its job?
This is the eror I get which is like first UI interaction:
Here are the steps I have performed:
Created an unattended robot with machine as the remote instance name.
Created an environment and connected with the robot created in step 1.
Setup UIPath Assistant using machine key and URL.
Published the files and then created the process in cloud console.
Ran it... less
I am a student and studying Computer Science. I am taking up Big Data Course this semester. As a part of curriculum, I am supposed to develop the Private Cloud using Ubuntu... moreI am a student and studying Computer Science. I am taking up Big Data Course this semester. As a part of curriculum, I am supposed to develop the Private Cloud using Ubuntu machines and other team needs to build up the authentication techniques for that private cloud. I am very new to bigdata and cloud even though i have basic understanding on concepts. I was going through the internet to see the resources on how to build cloud i came up with openstack which works best with ubuntu but before going any further into it i wanted to take the suggestions from stackoverflow community if they can guide me on the best tools and technology i can use to setup the private cloud. We now need to setup very small private cloud as a research project. Can anyone help me give me an idea on tools and technology please ? Appreciate the time.
I am trying to get live JSON data from RabbitMQ to Apache Spark using Java and do some realtime analytics out of it.
I am able to get the data and also do some basic SQL queries... moreI am trying to get live JSON data from RabbitMQ to Apache Spark using Java and do some realtime analytics out of it.
I am able to get the data and also do some basic SQL queries on it, but I am not able to figure out the grouping part.
Below is the JSON I have
{"DeviceId":"MAC-101","DeviceType":"Simulator-1","data":{"TimeStamp":"26-06-2017 16:43:41","FR":10,"ASSP":20,"Mode":1,"EMode":2,"ProgramNo":2,"Status":3,"Timeinmillisecs":636340922213668165}}
{"DeviceId":"MAC-101","DeviceType":"Simulator-1","data":{"TimeStamp":"26-06-2017 16:43:41","FR":10,"ASSP":20,"Mode":1,"EMode":2,"ProgramNo":2,"Status":3,"Timeinmillisecs":636340922213668165}}
{"DeviceId":"MAC-102","DeviceType":"Simulator-1","data":{"TimeStamp":"26-06-2017 16:43:41","FR":10,"ASSP":20,"Mode":1,"EMode":2,"ProgramNo":2,"Status":3,"Timeinmillisecs":636340922213668165}}
{"DeviceId":"MAC-102","DeviceType":"Simulator-1","data":{"TimeStamp":"26-06-2017... less
I want to know whether Artificial Neural Networks can be applied to discrete values inputs? I know they can be applied to continuous valued inputs, but can they be applied to... moreI want to know whether Artificial Neural Networks can be applied to discrete values inputs? I know they can be applied to continuous valued inputs, but can they be applied to discrete valued ones? Also, will perform well for discrete valued inputs?
How can I set Neural Networks so they accept and output a continuous range of values instead of a discrete ones? From what I recall from doing a Neural Network class a couple of... moreHow can I set Neural Networks so they accept and output a continuous range of values instead of a discrete ones? From what I recall from doing a Neural Network class a couple of years ago, the activation function would be a sigmoid, which yields a value between 0 and 1. If I want my neural network to yield a real valued scalar, what should I do? I thought maybe if I wanted a value between 0 and 10 I could just multiply the value by 10? What if I have negative values? Is this what people usually do or is there any other way? What about the input?
Thanks less
I realize that this is probably a very niche question, but has anyone had experience with working with continuous neural networks? I'm specifically interested in what a continuous... moreI realize that this is probably a very niche question, but has anyone had experience with working with continuous neural networks? I'm specifically interested in what a continuous neural network may be useful for vs what you normally use discrete neural networks for.
For clarity I will clear up what I mean by continuous neural network as I suppose it can be interpreted to mean different things. I do not mean that the activation function is continuous. Rather I allude to the idea of a increasing the number of neurons in the hidden layer to an infinite amount.
So for clarity, here is the architecture of your typical discreet NN: (source: garamatt at sites.google.com)
The x are the input, the g is the activation of the hidden layer, the v are the weights of the hidden layer, the w are the weights of the output layer, the b is the bias and apparently the output layer has a linear activation (namely none.)
The difference between a discrete NN and a continuous NN is depicted by this... less
Yesterday Google presented at Google I/O the new notification system based on the new Firebase. I tried this new FCM ( Firebase Cloud Messaging ) with the example on Github.
The... moreYesterday Google presented at Google I/O the new notification system based on the new Firebase. I tried this new FCM ( Firebase Cloud Messaging ) with the example on Github.
The icon of the notification is always the ic_launcher despite I have declared a specific drawable
Why ? Here below the official code for handling the message
public class AppFirebaseMessagingService extends FirebaseMessagingService {
/**
* Called when message is received.
*
* @param remoteMessage Object representing the message received from Firebase Cloud Messaging.
*/
//
@Override
public void onMessageReceived(RemoteMessage remoteMessage) {
// If the application is in the foreground handle both data and notification messages here.
// Also if you intend on generating your own notifications as a result of a received FCM
// message, here is where that should be initiated. See sendNotification method below.
sendNotification(remoteMessage);
}
//
Currently I'm interested in building a (small?) Internet of Things project. During research I found WSO2, an open source platform. I decided to use it and searched for developed... moreCurrently I'm interested in building a (small?) Internet of Things project. During research I found WSO2, an open source platform. I decided to use it and searched for developed projects. I found one decent project!
This project uses MQTT as communication protocol, Raspberry Pi<->Message Broker, and Message Broker<->Complex Event Manager.
My questions are the following:
1) Does the current version of the WSO2 Message Broker (v2.2.0) already support MQTT? Because I can't find documentation of this version supporting MQTT.
2) According to some references the WSO2 Message Broker v3.x.x will support MQTT, is that correct and when will this version be released?
3) Are there any other possibilities to use the WSO2 platform components in combination with the MQTT protocol?
4) Are there any other documented Internet of Things projects that use the WSO2 platform? less
I've got big RDD(1gb) in yarn cluster. On local machine, which use this cluster I have only 512 mb. I'd like to iterate over values in RDD on my local machine. I can't use... moreI've got big RDD(1gb) in yarn cluster. On local machine, which use this cluster I have only 512 mb. I'd like to iterate over values in RDD on my local machine. I can't use collect(), because it would create too big array locally which more then my heap. I need some iterative way. There is method iterator(), but it requires some additional information, I can't provide.