gradient

Computing Image Saliency via Neural Network Classifier

☆樱花仙子☆ 提交于 2019-12-04 11:05:50
Assume that we have a Convolutional Neural Network trained to classify (w.l.o.g. grayscale) images, in Tensor-Flow . Given the trained net and a test image one can trace which pixels of it are salient, or "equivalently" which pixels are most responsible for the output classification of the image. A nice, explanation and implementation details in Theano, are given in this article . Assume that for the first layer of convolutions that is directly linked with the input image, we do have the gradient for the parameters of every convolutional kernel-wrt. the classification function. How can one

Gradient effect for Line Graph in iPhone

点点圈 提交于 2019-12-04 10:25:50
I'm trying to generate a graph with gradient/shading effect. Now I'm able to draw line graph and applied gradient effect to that graph. It is applying to whole view not to the graph. Now I'm getting image like this. But I want like this. I want gradient effect just under the graph. Please help me in this. Thanks in advance. The code that I'm using is: UIGraphicsBeginImageContext(self.graphView.frame.size); [graphView.image drawInRect:CGRectMake(0, 0, self.graphView.frame.size.width, self.graphView.frame.size.height)]; CGContextSetLineCap(UIGraphicsGetCurrentContext(), kCGLineCapRound);

Is it possible to make a gradient-transparent/layer masking image using canvas?

时光怂恿深爱的人放手 提交于 2019-12-04 10:22:34
问题 I've been following the lessons about transparency and gradients on the Mozilla site: https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Canvas_tutorial/Applying_styles_and_colors but I have not been able to figure this one out. I know I can achieve these effects with a png image; however, in the program I am working on the gradient will change constantly according to where the image is moved. Here's an example of the effect I'm looking for. http://home.insightbb.com/~epyonxl1/gradientex

Procedural generation of a constrained landscape

雨燕双飞 提交于 2019-12-04 08:12:04
问题 I'd like to implement a procedural generation of a terrain. After a thorough research I came up with a conclusion that it should be implemented with one of the gradient (coherent) noise generation algorithms, for instance Perlin Noise algorithm. However, I don't want the generation to be completely random. I'd like to apply some constraints (like where should be a mountain range, or where should be a lowland etc.). Question: For example I have a curve which represents some landscape element.

How do you create a gradient for JPanel? Also, how do you call a class within a class in Java?

不羁岁月 提交于 2019-12-04 07:14:43
问题 I am making a Java GUI and I have searched the internet for 2 hours on how make a gradient for a JPanel. The code below is that I have, but when run the gradient does not show. What is wrong? I've tried many other posts from similar questions on this throughout the Internet but they don't work. I've tried numerous versions, but I also don't exactly know how to run a class within a class. Can someone help me please? class TestPanel extends JPanel{ @Override protected void paintComponent

MATLAB symbolic substitution

人盡茶涼 提交于 2019-12-04 06:12:47
问题 I know that in MATLAB if it is declared syms x y f=x^2+y^2 grad=gradient(f) Then grad will store value [2*x;2*y] If I want to evaluate the gradient at [2;2] I use subs(f,[x;y],[2,2]) This returns [4;4] I am coding a steepest descent algorithm that needs to be generic enough to take any function. I am wondering how to generically make use of syms and subs. Considering that some functions might not use the variables I have declared, like x and y . I know that MATLAB built in fminunc and fmincon

Data type mismatch in fortran

左心房为你撑大大i 提交于 2019-12-04 06:04:28
问题 I've written a rudimentary algorithm in Fortran 95 to calculate the gradient of a function (an example of which is prescribed in the code) using central differences augmented with a procedure known as Richardson extrapolation. function f(n,x) ! The scalar multivariable function to be differentiated integer :: n real(kind = kind(1d0)) :: x(n), f f = x(1)**5.d0 + cos(x(2)) + log(x(3)) - sqrt(x(4)) end function f !=====! !=====! !=====! program gradient !=========================================

iOS8: Auto-layout and Gradient

柔情痞子 提交于 2019-12-04 05:56:54
问题 Setup: I have a View Controller that consists of a View and a Container View . The View (Orange) is pinned to top 0, left 0, and right 0. The Container View (Gray) is pinned to bottom 0, left 0, and right 0. The View 's Bottom Space to: Container View = 0 The View 's Proportional Height to Container View = 1 Desired Results: I would like to add gradient to the background of the View (Orange) Tried: I'm using Auto-layout with class sizes to get different behavior on different screen. Code:

Parallelising gradient calculation in Julia

冷暖自知 提交于 2019-12-04 04:19:37
I was persuaded some time ago to drop my comfortable matlab programming and start programming in Julia. I have been working for a long with neural networks and I thought that, now with Julia, I could get things done faster by parallelising the calculation of the gradient. The gradient need not be calculated on the entire dataset in one go; instead one can split the calculation. For instance, by splitting the dataset in parts, we can calculate a partial gradient on each part. The total gradient is then calculated by adding up the partial gradients. Though, the principle is simple, when I

Android radial gradient

放肆的年华 提交于 2019-12-04 04:15:58
I've got following drawable set as LinearLayout background: <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item> <bitmap android:tileMode="repeat" android:dither="true" android:src="@drawable/bg"/> </item> <item> <shape android:shape="rectangle"> <gradient android:startColor="#ffff0000" android:endColor="#ff00ff00" android:centerX="50%" android:centerY="50%" android:gradientRadius="50%" android:type="radial"/> </shape> </item> </layer-list> According to the docs , gradientRadius can be set to percentage of window/parent size.