I know how to plot an arbitrary curve using the smooth interpolation, but what I want is to add annotations similar to the ones in the image below in order to illustrate how the learning rate works.
121883
I am trying to reconstruct this image here    I am not very happy with the code, as it uses hacking and adding white boxes and alike. My problem is now how do I draw the somewhat arbitary function in the figure? I tried to do a polynomial fit, but that did not work. I got dimensions to large, would a spline solution work better?    \documentclass{standalone}     \usepackage{tikz}     \usetikzlibrary{patterns}     \usepackage{pgfplots}     \pgfplotsset{compat=1.6}     \begin{document}     \begin{tikzpicture}      \begin{axis}[         xmin=-0.1,xmax=5,         xlabel={z},         ymin=0,ymax=4.5,     xtick={2.5,4},     xticklabels={$v_1$,$v_2$},     ytick={2.5,3.5},     yticklabels={$u_1$,$u_2$},     xlabel={$u$},       ylabel={$v$},     axis lines=middle]  \draw [fill=gray!40!white,thick,dashed] (axis cs:0,0) rectangle (axis cs:4,3.5); \draw [color=black,fill=white,thick,dashed] (axis cs:0,0) rectangle (axis cs:2.5,2); \draw [fill=black] (axis cs:0,0) rectangle (axis cs:0.01,4.45); \addplot+[black,thick,domain=0:5,no marks] {0}; % \node at (axis cs:2.5,0)    [anchor=south west] {$A$}; \node at (axis cs:4,0)      [anchor=south west] {$A'$}; \node at (axis cs:2.8,2.2)  [anchor=north]      {$B$}; \node at (axis cs:4.2,4)   [anchor=north]       {$B'$}; \node at (axis cs:0.25,2.5) [anchor=north]      {$C$}; \node at (axis cs:0.25,4)   [anchor=north]      {$C'$}; \node at (axis cs:0,0)     [anchor=south west]  {$O$}; % \end{axis} \end{tikzpicture} \end{document}
71668
It seems that the smooth option applied to lines sometimes effects the arrow tips and produces incorrect results.  No problem with vertical lines, but any other seems to have a problem. Is this a known bug, or is there a reason why the smooth should not be applied to straight lines?  Updated: to show problem does NOT occur with TikZ, and problem also occurs with curves if smooth option is applied.  \documentclass{article} \usepackage{pgfplots} \begin{document}  \tikzstyle{MyStyle}      =[-&gt;, black, ultra thick,       ] \tikzstyle{MyStyleSmooth}=[-&gt;, black, ultra thick, smooth]  \begin{tikzpicture} \begin{axis}     % 'smooth' option seems to have no effect on lines '1' and '2'     \addplot [MyStyle      , green ] coordinates{(0,0) (0,1)} node [above] {1};     \addplot [MyStyleSmooth, blue  ] coordinates{(1,0) (1,1)} node [below] {2};     %     % But, can't seem to have the 'smooth' on lines, '4', '5' and '6'     \addplot [MyStyle      , orange] coordinates{(2,0)   (3,0)   } node [right] {3};     \addplot [MyStyleSmooth, red   ] coordinates{(4,0)   (2,0.5) } node [below] {4};     \addplot [MyStyleSmooth, red   ] coordinates{(2,1)   (3,1)   } node [left ] {5};     \addplot [MyStyleSmooth, red   ] coordinates{(3,0.8) (2,0.8) } node [right] {6};      % Similar problem with curves: "non-smooth" is ok, "smooth" is not     \addplot[MyStyle,       mark=none, domain=0:1,samples=50, blue] (x,x*x+1);     \addplot[MyStyleSmooth, mark=none, domain=0:1,samples=50, red ] (x,x*x+2);  \end{axis} \end{tikzpicture}  \begin{tikzpicture} % These are all fine     \draw [MyStyle      , green ] (0,0)   -- (0,1)    node [above] {1};     \draw [MyStyleSmooth, blue  ] (1,0)   -- (1,1)    node [above] {2};     %     \draw [MyStyle      , orange] (2,0)   -- (3,0)    node [right] {3};     \draw [MyStyleSmooth, red   ] (4,0)   -- (2,0.5)  node [below] {4};     \draw [MyStyleSmooth, red   ] (2,1)   -- (3,1)    node [right] {5};     \draw [MyStyleSmooth, red   ] (3,0.8) -- (2,0.8)  node [left ] {6}; \end{tikzpicture} \end{document}
112816
I'm working on creating an illustration that I will need in many, different guises in differential geometry/manifold theory etc. Following on from a previous (answered) question of mine (, I want to show how two coordinate lines in the plane originate from two curves on a surface via the chosen map:  \begin{tikzpicture}     \begin{axis}[             name=mfd,             declare function={                     f(\x,\y)=10-(\x^2+\y^2);             },                   declare function={                     c_x(\t)=(cos(\t)+(sin(5*\t)/10))/3+1;             },                   declare function={                     c_y(\t)=(sin(\t))/2-1;             },                   declare function={                     c_z(\t)=f(c_x(\t),c_y(\t));             },           ]                    \addplot3[surf,domain=-2:2,domain y=-2:2,]{f(x,y)};             \addplot3[black,opacity=1.0,variable=t,domain=0:360,dashed,thin] ({c_x(t)},{c_y(t)},{c_z(t)});             \addplot3[black,opacity=1.0,variable=t,domain=-2:2,thin] (t,-1.2,{f(t,-1.2)});             \addplot3[black,opacity=1.0,variable=t,domain=-2:2,thin] (0.8,t,{f(t,-1.2)});             \addplot3[black,opacity=1.0,only marks,mark=text,text mark=$\cdot$] (1,-1,{f(1,-1)}) coordinate (a);     \end{axis}     \begin{axis}[             at={($(mfd.north east)+(1cm,-2cm)$)},             anchor=north west,             declare function={                     c_x(\t)=(cos(\t)+(sin(5*\t)/10))/3+1;             },                   declare function={                     c_y(\t)=(sin(\t))/2-1;             }            ]                    \addplot[variable=t,domain=0:360]({c_x(t)},{c_y(t)});             \addplot[black,opacity=1.0,only marks,mark=text,text mark=$\cdot$] (1,-1) coordinate (b);             \addplot[variable=t,domain=0.6:1.4](t,-1.2);             \addplot[variable=t,domain=-1.5:-0.5](0.8,t);     \end{axis}     \draw [-stealth, shorten &lt;= 3pt, shorten &gt;= 3pt] (a) to[bend left] (b); \end{tikzpicture}   However, I have a couple of problems:   The curves representing the coordinate axes pulled back from the plane via the coordinate map insist on being closed off with a straight line - is there a way to avoid that? I want to draw all the black curves with a thin, dashed line, but I probably don't understand how to set those options. What am I doing wrong?   I apologise if these questions are rather elementary, but I find the relevant manuals difficult to search through; they seem to be meant for reading cover to cover rather than reference.
108050
Complete noobie to Blender here.  I was wondering if there was a way to add the bumps from a normal map into a model so I can 3D print it with all the indents and such.  I assume it's something to do with the Displacement modifier but I have absolutely no idea how to use it or any nodes or such.  If you need more info on what the normal maps look like and such I'll be happy to send them.
7739
I've used mathutils.geometry.interpolate_bezier() in the past to create points for a curve using the bezier handle and knot coordinates.  from the docs:     interpolate_bezier(knot1, handle1, handle2, knot2, resolution)   My question is; given an existing curve in the scene, is there a neat way to get at the points that describe the curve without converting it to a mesh, or figuring out which handle (left or right) to use for each spline point.  curve = bpy.data.curves[0].splines[0] curve.bezier_points[0].co curve.bezier_points[0].handle_left curve.bezier_points[0].handle_right
56803
Is possible to place/spawn objects along curve with randomized scale and rotation? I'm looking for lazy way to create flowers and randomized procedural patterns. Thanks
102953
I´m trying to model a race track using a bezier curve, but, when I add modifiers -> array -> curve I get this :    What should I check for to get the mesh following the curve correctly ? Thankyou
112545
I am searching for a way to have a figure drawn using LaTeX. I am aware of some packages TikZ and PSTricks that could accomplish this, and have been tinkering around with them recently but do not have enough skill set at the moment to accomplish this drawing. Is there a way someone can accomplish the drawing, preferably with TikZ but could be any package your most comfortable with in a reduced amount of coding (non-advanced) to where I could understand what is happening from the code to the picture. If this is not possible, then I will have to study the package more and work with it until I understand the method (code) to create the graphic. The drawing is below.  Note: This is a rough sketch. The optimal output would have smooth quadratic curves and all quantities are vectors.
7670
The unique style of the diagrams at  has an informative but nice hand-drawn touch. I guess they are actually drawn by hand but just recently on our partner site for Mathematica someone asked how to draw a similar diagram such as this one with Mathematica's plot functions ().    Now without Mathematica this should be possible as well but I have a hard time getting the details right. Can such a diagram be created in TeX with a similar design? My first attempt does not look particularly great but here it is (the font is from ):      \documentclass{standalone}     \usepackage{tikz,color}     \usepackage{pgfplots}     \usepackage{fontspec}     \setmainfont{Humor-Sans}      \begin{document}     \begin{tikzpicture}     \pgfplotsset{every axis/.append style={line width=1pt}}      \begin{axis}[%         axis x line=bottom,         axis y line=left,         xtick={1.2, 2.9, 4.5},         xticklabels={-3 days, -1 day, 5 minutes},         yticklabels={}     ]     % 1st plot     \addplot [cyan!80!white, samples=200, domain=0:6] {0.05*rnd+3+(sin(deg(x))^2)/sqrt(x)*exp(-(x-2))};     % white background for 2nd plot     \addplot [white, samples=200, domain=0:6,line width=4pt] {0.05*rnd+0.4*x+2+x^2*sin(deg(x))^2*exp(-x)};      % 2nd plot     \addplot [red!80!white, samples=200, domain=0:6] {0.05*rnd+0.4*x+2+x^2*sin(deg(x))^2*exp(-x)};      \end{axis}       \node at (2.7,4.6) {downhill};     \draw  plot[smooth, tension=.7,line width=2pt] coordinates {(1.2679,5.5206) (1.9454,5.493) (2.4017,4.9261)};      \end{tikzpicture}      \end{document}
59278
I have an idea for working with geospatial rasters to predict housing prices.  I have done this before using mulitivariate linear regression.  I would like to try using a convolutional neural network.  I have a series of rasters that represent a surface of interpolated housing prices over time.  The convolutional neural network will learn from the price rasters, but I need to add in other explanatory variables. The most important is time.  I might add additional scalar values such as interest rate or stock market.  I might also want to add additional rasters as regressors, such as crime maps, or distance to transit.  I know that in a typical neural network regression there is one neuron per explanatory variable, and in a typical CNN there is a neuron per pixel on the input layer.  So I would like some regressors to be rasters, and some to be scalers.  My question is how do I add additional explanatory variables, both rasters and scalars, to a convolutional neural network?  I am using Keras and TensorFlow.
88329
I understand that neural networks (NNs) can be considered universal approximators to both functions and their derivatives, under certain assumptions (on both the network and the function to approximate). In fact, I have done a number of tests on simple, yet non-trivial functions (e.g., polynomials), and it seems that I can indeed approximate them and their first derivatives well (an example is shown below).   What is not clear to me, however, is whether the theorems that lead to the above extend (or perhaps could be extended) to functionals and their functional derivatives. Consider, for example, the functional: \begin{equation}     F[f(x)] = \int_a^b dx ~ f(x) g(x) \end{equation} with the functional derivative: \begin{equation}     \frac{\delta F[f(x)]}{\delta f(x)} = g(x) \end{equation} where $f(x)$ depends entirely, and non-trivially, on $g(x)$. Can a NN learn the above mapping and its functional derivative? More specifically, if one discretizes the domain $x$ over $[a,b]$ and provides $f(x)$ (at the discretized points) as input and $F[f(x)]$ as output, can a NN learn this mapping correctly (at least theoretically)? If so, can it also learn the mapping's functional derivative?   I have done a number of tests, and it seems that a NN may indeed learn the mapping $F[f(x)]$, to some extent. However, while the accuracy of this mapping is OK, it is not great; and troubling is that the computed functional derivative is complete garbage (though both of these could be related to issues with training, etc.). An example is shown below.  If a NN is not suitable for learning a functional and its functional derivative, is there another machine learning method that is?  Examples:  (1) The following is an example of approximating a function and its derivative: A NN was trained to learn the function $f(x) = x^3 + x + 0.5$ over the range [-3,2]:   from which a reasonable approximation to $df(x)/dx$ is obtained:   Note that, as expected, the NN approximation to $f(x)$ and its first derivative improve with the number of training points, NN architecture, as better minima are found during training, etc.  (2) The following is an example of approximating a functional and its functional derivative: A NN was trained to learn the functional $F[f(x)] = \int_1^2 dx ~ f(x)^2$. Training data was obtained using functions of the form $f(x) = a x^b$, where $a$ and $b$ were randomly generated. The following plot illustrates that the NN is indeed able to approximate $F[f(x)]$ quite well:    Calculated functional derivatives, however, are complete garbage; an example (for a specific $f(x)$) is shown below:   As an interesting note, the NN approximation to $F[f(x)]$ seems to improve with the number of training points, etc. (as in example (1)), yet the functional derivative does not.
63161
Whats a quick way to work the below (and problems similar) out?   For me to take this derivative it involves a lot of time and boring calculation, there has to be a better way.    This is taken from the solutions to Chris Bishop's Pattern Recognition and Machine learning:
72765
i know how to draw axis and everything else except the function here , please give me hint to plot this function    Thanks for the help
39206
I have dataset of 15 features and the goal is to estimate a best fitting curve (regression). Now I want to use a deep learning technique for this purpose. Now I see that there are many architectures that can be used such as CNN, DBM or auto-encoder, etc.. Which one to go for. And I could not find any examples for how to use the same. A sample code would be of great help. Thanks  P.S. Some of the features are categorical. How do we handle that as well?
113279
Interpolation typically means modeling the values of some curve inside the given data, and extrapolation&nbsp;— outside the given data. For example, if I know the temperature on Monday and Wednesday, and ask for what it was on Tuesday&nbsp;— this is interpolation. If I ask for what it was on Sunday before or Thursday after, it is extrapolation.  I am looking for a word that would encompass both. I thought of modeling, but is there perhaps something better?
50907
I need to plot a few graphs. First is of the function      \begin{equation}     x(t)= -e^{ -(0.1 \ {s}^{-1}) t} \cos \left( ( 0.995 \ {rad} / \mathrm{s})t \right)     \end{equation}   and of $\dot{x}$ (time derivative function)   \begin{equation}     \dot{x}(t)= e^{-(0.1 \ {s}^{-1}) t}\left[(0.1 \ {s}^{-1}) \cos \left( ( 0.995 \ {rad} / \mathrm{s})t \right)+ ( 0.995 \ {rad} / \mathrm{s})\sin ( ( 0.995 \ {rad} / \mathrm{s})t )\right] . \end{equation}   I have so far made their individual plots by doing the following      \begin{figure}[ht]     \centering         \caption{ The plots of the position and speed versus time (underdamped oscillator).} \begin{tikzpicture}[scale=1.9] \begin{axis}[     axis lines = left,     xlabel = {$t$, $ \left[\text{s} \right]$},     %ylabel = {$a(t)$, $ \left[\text{m/s}^2 \right]$},     grid=major,     ymin=-1,     ymax=1, ] \addplot [     domain=0:60,       samples=300,      color=YellowGreen,      thick, ] {2.71828^(-0.1*x)*cos(deg(0.995*x-3.1415))}; \addlegendentry{\tiny $ x(t)$, , $ \left[\text{cm} \right]$} \addplot [     domain=0:60,      samples=300,     color=TealBlue,      thick,     ]     {-2.71828^(-0.1*x)*((0.1*cos(deg(0.995*x-3.1415))+0.995*sin(deg(0.995*x-3.1415))) }; \addlegendentry{\tiny $  \dot{x}(t)$,  $ \left[\text{cm/s} \right]$} \end{axis} \end{tikzpicture} \end{figure}   with the resulting graph    What remains a problem: question 1. The second plot I need is the phase diagram, i.e. $\dot{x}(t)$ vs $x(t)$ plot, which I am not sure how to construct. I was thinking sampling/point-harvesting of the function $x(t)$ and $\dot{x}(t)$ to then use those points for interpolation-construction of the phase diagram might be somehow implemented? However, I could not find a lot of information about these kinds of things on latex forums. My boyfriend has made his graphs with python, so I know the phase diagram must look like the following    But I was hoping to there is some way of making the graphs using latex alone. Any ideas?  What remains a problem: question 2. I also was wondering if there is any way of determining how many times does the system cross the $x=0$ line before the amplitude falls below $10^{-2}$ of its maximum value, but if it is possible to do only using latex commands to output this number.
114551
I am brand new to blender and trying to make something and I want to add a circle curve so I pressed shift+a to add it but the popup menu only lets me add meshes. If anyone could help me I would be so happy :)