Questions tagged [gradient]

Specifies a range of position-dependent colors, usually used to fill a region.

gradient
1,269 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
1 vote
0 answers
202 views

In android UI is it possible to define gradient color on chip class?

I am using the class com.google.android.material.chip.ChipDrawable for defining input text field. I would like the default value to be shown in dark blue gradient color, However I didn't find a way to ...
eladper's user avatar
  • 11
1 vote
1 answer
276 views

How to apply gradient color to Flutter Icon on the web?

I know ShaderMask is not supported on web, but I would need a way to apply gradients to icons on web. I spent a good few hours trying to find a workaround but couldn't. Any tips?
Laczkó Örs's user avatar
  • 1,108
1 vote
0 answers
124 views

Recover image from its X and Y gradients

I have a single channel image from which I can compute its vertical and horizontal gradients. I would like to make some operations in the gradient domain and subsequently recover back the scalar field ...
ElPotac's user avatar
  • 35
1 vote
1 answer
1k views

Replace colored background with gradient background for flutter app depending on dark / light mode

I would like to change the standard theme background colors of my flutter app to gradient background, depending on dark / light mode. so that the light mode shows a different gradient like the dark ...
user avatar
1 vote
0 answers
727 views

type object 'Adam' has no attribute 'compute_gradients'

I am going to calculate the loss gradient with respect to networks parameters (weights) while I am having multiple outputs. I implemented following command tf.keras.optimizers.Adam.compute_gradients(...
Alborz's user avatar
  • 11
1 vote
0 answers
643 views

How can I overlay an angled gradient or fade over the corner of a video with ffmpeg?

I want to darken the corner of a video with a (for instance) 45-degree black gradient. I'd like to customize the angle, feathering, color and opacity. My video is 10-bit UHD HEVC and I need to ...
grgoelyk's user avatar
  • 417
1 vote
0 answers
20 views

How apply gradient boosting to this function and this data?

def square_A(B_estimated, x, y): B_estimated = np.matrix(B_estimated) z = y - np.dot(x, B_estimated.T) return np.dot(z.T, z) # Where x and y is defined here: m = 1000 n = 100 x0 = np.ones(...
javier's user avatar
  • 15
1 vote
1 answer
135 views

Plot multiple 2D gradient Data sets with colorbar. Problem: Python plots mutiple colorbar

I am working on some project where I want to compare two different solution of some equation I am solving. I have some data that are time and Space (x,y) dependent. which means I have for every time ...
Zino Belkadi's user avatar
1 vote
0 answers
380 views

understanding pytorch sample code for gradient calculation

I do not understand the purpose of the following line of code: external_grad = torch.tensor([1., 1.]) Q.backward(gradient=external_grad) Here's the complete program from https://pytorch.org/tutorials/...
LP0's user avatar
  • 107
1 vote
0 answers
437 views

Swift: How to mask a UICollectionView's background to only be seen behind visible cells?

Introduction Hello, I have added a background view with a CAGradientLayer, and my UICollectionViewCells have a hole in them to see the background. So far, it all looks great: The Problem However, ...
Josh Arnold's user avatar
1 vote
1 answer
520 views

PyTorch - efficiently apply TopK gradient coordinates in NN

I have a sequential neural network (standard ResNet model), and for a constant k (about 1000, but may potentially increase in the future) I want to do the following: Find the gradient of NN. Identify ...
user avatar
1 vote
0 answers
77 views

What types of operations will/will not plugin the computational graph in the Tensorflow 2?

Based on this post, we can change the tf.variable threshold = 3 a = np.array([1,2,3,4,5,6]) b = tf.Variable(a) b = tf.where(b >= threshold, 199, b) Will b=tf.where(b>=3, 199, b) be plugin to ...
jason's user avatar
  • 2,108
1 vote
0 answers
1k views

Tensorflow: gradients suddenly became NaNs during training

I am training simple variational autoencoder with negative binomial likelihood for decoder. I used python 3.7.1 and tensorflow 2.0.0. The model was trained well without any problems for tens of epochs,...
Jay Lee's user avatar
  • 11
1 vote
0 answers
132 views

Merge different kinds of android gradients programmatically

I have a question about android gradients (RadialGradient and LinearGradient). As you can see on the image above, I made two tests : First circle : LinearGradient from blue to red private fun ...
Boysteuf's user avatar
  • 223
1 vote
0 answers
100 views

White strange pixels in html canvas after using gradient fillRect with opacity multiple time

I was using html canvas, creating context filling with alpha gradient color multiple time, and then I've noticed some white dot artifacts as the image shown below. Testing done in Chrome with Windows,...
Hikariztw's user avatar
  • 113
1 vote
0 answers
117 views

Trying to use tf.constant as loss value results in gradient returning None's, better way to do it?

I am trying to make my own GAN for a simple game AI after some limited (but successful) experience using tf keras for image related functions with a more standard CNN. In making the switch to this new ...
Fred E's user avatar
  • 131
1 vote
0 answers
63 views

what is the difference between do output.backward(gradient=df) and loss.backward()?

I am currently testing an open source repository(https://github.com/jzengust/RGBD2Normal) for surface normal estimation, the following function is used as the surface normal loss function: def l1norm(...
Alisa's user avatar
  • 11
1 vote
0 answers
62 views

No gradients provided for any variable / custom loss

OK so I'm trying to implement this custom loss I read in a paper and it's my first custom loss so I might be missing something obvious, but I get the error shown below. From other posts I gather that ...
Stargazer's user avatar
1 vote
0 answers
161 views

Color gradient on one contour line

I'm very very new to Python, i usually do my animations with AfterEffects, but it requires a lot of computation time for quite simple things. • So I would like to create this kind of animation (or at ...
LauraQuern's user avatar
1 vote
0 answers
209 views

How do I add gradient to an svg path from getwaves.io?

I couldn't find this exact same question anywhere else but I would like to know how I can add gradient to an svg like this one below (from getwaves.io): < svg xmlns="http://www.w3.org/2000/svg&...
codonoty's user avatar
1 vote
0 answers
453 views

How to calculate mask-image gradient consistency loss in tensorflow

I want to create custom loss function as described in this article Real-time deep hair matting on mobile devices. I have implemented it in TF2.0 (Google Colab) it worked with no errors. However I don'...
baymak's user avatar
  • 99
1 vote
0 answers
38 views

Calculate gradient of trained network

assume I got a trained model, I am trying to calculate it's Jacobin (trying to understand some it's mathematical properties after training). I am trying to use autograd as follow: from autograd import ...
user213158's user avatar
1 vote
1 answer
522 views

How to combine duotone effect and CSS mix-blend-mode:difference

I have a pretty specific case I can't solve here. I'm currently trying to implement a design that relies heavily on gradients and blend modes. What I'm trying to achieve is this effect where black ...
Paul Lacour's user avatar
1 vote
0 answers
178 views

How to calculate the back-propagation of conv3d in tensorflow manually?

In tensorflow, for 2D convolution there is a useful comment on how the back-propagation w.r.t input and weight can be mapped to 2D convolution again. You can find it here. I know the basic fundamental ...
Hamed's user avatar
  • 315
1 vote
1 answer
64 views

Gradient background scaled after resizing ViewGroup

In my app, I have ConstraitLayout with a gradient background. In a runtime, this ConstraitLayout can be resized. The problem I faced is that gradient drawable "isn't scaled". I will show an ...
iknow's user avatar
  • 9,164
1 vote
0 answers
23 views

Tensorflow - Unable to obtain gradients between loss and input image

I'm trying to produce adversarial examples for a semantic segmentation classifier, which involves optimising an image based using the gradients of the loss with respect to the input image variable (...
JonSchtuk's user avatar
1 vote
0 answers
1k views

Tensorflow gradient returns none

I am trying to calculate the gradient of the option price y respect to the input spot price. Here is my code. Now it seems like gradient is not none, but it returns tensor error, which I think I did ...
Gevi's user avatar
  • 21
1 vote
0 answers
867 views

Tensorflow: How do I pass the gradient through an integer tensor?

I am having an issue maintaining the flow of gradients across a custom operation in my W-GAN network that I built with TensorFloww and Keras. I have structured the W-GAN to learn to produce an image &...
kjm944's user avatar
  • 11
1 vote
1 answer
745 views

non uniform spacing, multivariate derivative with numpy.gradient

so I'm trying to get the second derivative of the following formula using numpy.gradient, and I'm trying to differentiate it once by S[:,0] and then by S[:,1] S = np.random.multivariate_normal(mean, ...
Ahmed Alarbi's user avatar
1 vote
0 answers
100 views

Manually calculated gradient not matching autograd

I'm trying to calculate a gradient of a function that is A*A*X*W0*W1 w.r.t A in PyTorch. I have calculated the gradient manually but I'm not getting the same answer as the pytorch's auto grad function....
Kai-Eiji's user avatar
1 vote
0 answers
473 views

How to create a transparent gradient along the edge of an image/mask image with python?

Basically I want to create of a halo effect for the image that fades to transparent. I have images of wounds (and their masks), with no background. I want to add a red gradient behind it, that way if ...
kitty Kat's user avatar
1 vote
0 answers
198 views

How to find the gradient of grid-less data in python?

I have a pandas data frame containing location data (x_m and y_m) and another variable represented by the color bar in the figure. Sample figure showing the data points and a possible gradient arrow ...
Marcelo Fernandes's user avatar
1 vote
0 answers
39 views

How can i find gradient input?

How can i find log likilihood layer if i have: logP = [[-5.8971105e+00 -1.3536860e-01 -2.3225722e+00 -3.6559267e+00] [-7.1035299e+00 -7.1037712e+00 -8.0828800e+00 -1.9549085e-03]] oneHotTruth ...
annaFerdsf's user avatar
1 vote
0 answers
46 views

How to prevent the gradient to pass through a calculation an a custom layer?

I have a custom layer, which I want to train in a model. The layer is defined by this code: import tensorflow as tf from tensorflow.keras import layers import tensorflow as tf class RecLayer(layers....
Sebastian's user avatar
1 vote
1 answer
184 views

text style with gradient color

I would like to set the style for TextView. It should have the black stroke on letters and be of a gradient colour (horizontal one) to be used on multiple texts. In case if I am creating the ...
Nsem's user avatar
  • 21
1 vote
0 answers
86 views

Why I am getting error on numericDeriv Error in R

I am trying to fit a simple nonlinear model in R but getting an error that I do not understand x = c(0.0, 0.5, 1.0, 1.5, 2.0) y = c(6085, 2351, 940, 371, 145) fit <- nls(y ~ exp(a+b*x), start=...
hxd1011's user avatar
  • 905
1 vote
1 answer
153 views

Gradient usage in android studio

I am the newly in android studio. Just reading and studying in regards to the gradient usage. Is it possible to use gradient colour for the floating button for it to fill the whole shape? As well, ...
Nsem's user avatar
  • 21
1 vote
0 answers
323 views

Tensorboard in Tensorflow 2.0: Plot activations and gradients of a model

First of all, in the tensorflow documentation about Tensorboard callback https://www.tensorflow.org/api_docs/python/tf/keras/callbacks/TensorBoard , they are mentioning that you can plot histograms of ...
Ζι Βάγγο's user avatar
1 vote
0 answers
84 views

multiple textview in layout to follow a gradient color [Android]

I am trying to set a gradient color to multiple textviews in a linearlayout, the start and end color the gradient, should start from the top to bottom of the layout
HK92's user avatar
  • 43
1 vote
1 answer
754 views

Why do we average the losses of all elements of the batch if we typically should average the gradients (rather than the losses)?

My loss output is tensor([0.0430, 0.0443, 0.0430, 0.0430, 0.0443, 0.0466, 0.0466, 0.0466], grad_fn=<AddBackward0>) When I execute loss.backward(), I obtained *** RuntimeError: grad can ...
J.G's user avatar
  • 197
1 vote
1 answer
356 views

PyTorch gradient calculation gives unexpected results

The following code is intended to explain how the PyTorch gradient calculation works, and it should, IMO return the weights matrix, but it doesn't: # the code calculates T x W + B ---> K1 # ...
joseph pareti's user avatar
1 vote
1 answer
42 views

Theano gradients failing over scan operation

Implementing deep networks in theano gives me precise control over my layers from the ground up. I know it's no longer supported but it appears to me there is still active use (from me at least :->). ...
Charles Pehlivanian's user avatar
1 vote
1 answer
164 views

In TensorFlow 2.0 with eager-execution, how to compute the gradients of a network output wrt input layer?

I use network InceptionV3, I want to compute the gradients of the model output w.r.t. the input layer. I have the following code: origin_image = load_img("dog.jpg", target_size=(299, 299)) ...
NGHĨA VŨ ĐỨC's user avatar
1 vote
1 answer
635 views

BottomNavigationView's titles' color being a gradient

I need to make the titles in BottomNavigationView in android be of a gradient color. <?xml version="1.0" encoding="utf-8"?> <gradient xmlns:android="http://schemas.android.com/apk/res/...
guv4's user avatar
  • 11
1 vote
0 answers
527 views

The method to use gradient accumulate in BERT finetune

I was doing a Bert finetune and I had OOM issues. I heard a good method to handle this is to use "gradient accumulate". Below are my optimization.py(include the gradient accumulate) from __future__ ...
652994331's user avatar
1 vote
2 answers
2k views

How to add gradient to header ExpansionTile in Flutter

Im trying to achieve certain look in my ExpansionTile, 1. When collapsed solid header color 2. When expanded gradient in header only not in the body with elements. This is what im trying to achieve: ...
Alex Apps's user avatar
  • 317
1 vote
0 answers
390 views

TensorFlow Adding C++ Gradient for a Custom Op

I'm currently working on a project where I have to add a custom loss function to the tensorflow (1.13.1) C++ API. This function relies on some external libraries, so my idea was to add this loss ...
Simon's user avatar
  • 13
1 vote
0 answers
87 views

Animating counting number with gradient background

I am trying to make a counting animation on numbers with a gradient background. However, it does not seem to be possible to make this work if the numbers have a gradient background, with my current ...
randomdev91's user avatar
1 vote
2 answers
537 views

Css gradient where color values are derived from element props

I'm rendering data cards for Pokemon. Each pokemon type has an associated color. Fire is red, water is blue, grass is green. Some pokemon have one type, some pokemon have 2 types. I want the ...
Astrydax's user avatar
  • 465
1 vote
0 answers
259 views

CSS thead gradient-background on mobile issue

I have a gradient in my table css. On desktop browsers like Chrome, Firefox and Safari it looks as intended, however on mobile browsers it does not have the intended effect. Gradient is supposed to ...
Jack Baker's user avatar

1
4 5
6
7 8
26