A list of puns related to "Scalar Function"
If f(t) is in L_2, does that imply that it is in L_infinity?
Background:
I know that if f(t) is in L_2, and g(t) is in L_infinity, then their product f(t)*g(t) is in L_2.
But if I know that h(t)*k(t) is in L_2, can I conclude that both h(t) and k(t)?
Sorry for the basic question. I am trying to build a solid understanding from the ground up. Edit: i meant complex scalar field. Autocorrect is BS.
In most examples I've seen using activation functions the desired result is a boolean, like in giant_neural_network's series where the machine tries to determine whether a flower is red or blue based on its length and width. Is it useful for predicting scalars too (as in trying to predict the width based on the length and color)? Maybe by activating and deactivating certain weights?
So trying to dynamically categorize transactions from my banking statements.
Thing is the vendor/payee name often includes a specific transaction number or seller number so instead of paying 'amazon market place' the payee is 'amazon marketplace somespecificsellerid'
I was thinking of having a rules table with a stub column that would be equivalent to an assert statement 'vendor like 'amazon marketplace%'
Ideally I could join to this rule table and the scalar function would return true is the assert would pass
if i had a function like f(x,y) = 2x-y, how would i find the inverse of it?
https://www.desmos.com/calculator/iv4ec9hmcv
https://preview.redd.it/1z5dwat0g2z61.png?width=238&format=png&auto=webp&s=dd172ed980a2e28de75604461094ff2f0edcca4f
I am attempting to plot the pitchwise mass averaged data for multiple scalar functions against span for a stator blade in a turbine. The data is from a plane at the exit of the stator blade. I have tried using the mass flow averaged report but I can only seem to get a value for the whole plane. Is there a way to get the pitchwise mass averaged data on this plane plotted against span.
Here is the plane I am attempting to do this on https://imgur.com/a/mW3CDvB
This is being done in STAR-CCM+. I am fairly new to CFD so I apologise if I have missed something very basic but help would be appreciated.
This simulation is being done to mimic a physical experiment and the measurements for that were doen with a measurement plane with circumferential points to get this data. (if this is of any use)
Thank you!
If T(x)=x, then for some scalar b, bT(x)=bx=T(bx) by linearity of T.
Is this a sufficient proof?
The question is in the title, i didn't get the concept of tensors and i've been looking to find an answer to that. Can anyone enlighten me?
I have a big query, (really big, 800+columns - can't really make it smaller) that I'm trying to build in the most efficient way.
I have some fields like this:
SELECT distinct(td.EVENT_ID),
td.MENU_HINT,
td.EVENT_NAME,
td.EVENT_DT AS Expr1003,
COUNT(td.EVENT_NAME) AS [Total Runners],
-- AS [WinnerPrice],
-- COUNT(td.ID) AS [WinnerCount],
SUM(CASE WHEN td.BSP >= 1 AND td.BSP < 2 THEN td.BSP END) AS Sum1to2,
count(CASE WHEN td.BSP >= 1 AND td.BSP < 2 THEN td.BSP END) AS count1to2,
avg(CASE WHEN td.BSP >= 1 AND td.BSP < 2 THEN td.BSP END) AS average1to2,
dbo.FN_SumWinnerRunners(td.EVENT_ID,34,55,0,7,12) AS [TEST FUNCTION],
SUM(CASE WHEN (td.BSP >= 2 AND td.BSP < 3) AND td.WIN_LOSE =1 THEN td.BSP END) AS SumWinnerPrice2to3,
count(CASE WHEN (td.BSP >= 2 AND td.BSP < 3) AND td.WIN_LOSE =1 THEN td.BSP END) AS CountWinnerPrice2to3
FROM tblData td
GROUP BY td.EVENT_ID,
td.MENU_HINT,
td.EVENT_NAME,
td.EVENT_DT
ORDER BY [Total Runners] DESC;
And here a graphical one (click to enlarge):
https://preview.redd.it/5xpivq1wvum41.png?width=1039&format=png&auto=webp&s=c77b04efb616ad4c7909da16b8c39ace75ba429e
if you notice, I've tried, as I have several queries that are fairly similar, to use a function (dbo.FN_SumWinnerRunners(td.EVENT_ID,34,55,0,7,12)
the definition for it below:
CREATE FUNCTION [dbo].[FN_SumWinnerRunners](
@event_id INT,
@BSPFrom SMALLINT,
@BSPTo SMALLINT,
@Win_Lose SMALLINT,
@RunnersFrom SMALLINT,
@RunnersTo SMALLINT)
RETURNS FLOAT
AS
BEGIN
DECLARE @result FLOAT=
(
SELECT SUM(CASE
WHEN(td.BSP >= @BSPFrom
AND td.BSP < @BSPTo)
AND td.WIN_LOSE = @Win_Lose
THEN td.BSP
END)
FROM tblData td
WHERE td.EVENT_ID = @event_id
HAVING COUNT(td.EVENT_NAME) > @RunnersFrom
... keep reading on reddit β‘Hi community.
I have a computationally expensive scalar function f(r)
of a large vector. My aim is to find its local minima using some heuristics starting from many different r0
. I can do it directly (using CG, etc) but it takes a lot of computational time to do it.
Instead, I would like to learn g(r) β f(r)
and to find local minima of the learned function within some error bar err
. I am free to generate arbitrary learning datasets as long as they are not too large. I hope that learning the function in the proximity of a few local minima will enable me to do that.
So my workflow is as follows: I learn the function g
from the dataset of {r_i -> f(r_i)}
, I test its values |g(r) - f(r)| < err
and then I minimize the learned function g
. This produces reasonable r_min
(i.e. it remains close to the local minimum), however, |g(r_min) - f(r_min)| > err
is still too large. Despite my dataset containing a lot of data close to local minima and despite random checks producing reasonable error bars minimization of g(r)
always ends up at some "special" values of r_min
with a much larger error bar.
My NN is quite simple (4 layers) and the learning process just minimizes |g(r) - f(r)|
. What can go wrong here?
Hi Iβm trying to define a passive scalar location for my tank (which has no inlet) as a spherical ball (equation x^2 + y^2 + z^2 = 0.1). Essentially a sphere of radius sqrt(0.1) at origin. What would be the syntax for this?
I'm refreshing my multivariable calculus w/ a Coursera course, and when referring to the Jacobian they mention that "if you calculate it (the Jacobian) for a scalar valued multivaraible function you get a row vector pointing in the direction of greatest slope...".
I understand what a multivariable function is, but this is the first time I've heard any reference to a "scalar-valued" function. What does that mean?
Hi guys,
Relatively new to PS but I've spent hours trying to get to the bottom of this and now hope you can help.
I'm trying to run a SQL Function that returns a single result, not as the output but as the return value.
The function I'm running is dbo.WsParameterReadf('FPF_START_TIME'), which when run in a SQL browser returns the expected value '2019-12-17 17:43:12', a string representation of a date. The function itself is described as 'scalar-value function WherescapeMetaRepo.dbo.WsParameterReadF(@p_parameter varchar(64)) RETURNS varchar(4000), and as normal works by using EXEC or SELECT.
I've attempted two functions to get this value but both have been unsuccessful. I would appreciate any help!
Attempt 1:
function getParam($Parameter)
{
$RepoCon = New-Object System.Data.Odbc.OdbcConnection($RepoConStr)
$RepoCon.ConnectionString = "DSN=${env:WSL_META_DSN}; Integrated Security=true;"
$RepoCon.Open()
$cmd = New-Object System.Data.Odbc.OdbcCommand
$cmd.Connection = $RepoCon
$cmd.CommandText = "SELECT dbo.WsParameterReadf('$Parameter');"
$result = $cmd.ExecuteReader()
try
{
while ($result.Read())
{
Add-Content $FILELOG "try: SELECT dbo.WsParameterReadf('$Parameter') ($result.GetValue($1))"
return $result.GetValue($1)
}
}
catch
{
Add-Content $FILELOG "catch: $_.Exception.Message"
}
finally
{
$RepoCon.Close()
$RepoCon.Dispose()
$cmd.Dispose()
}
}
$out = getParam("FPF_START_TIME")
Add-Content $FILELOG "out: $out"
Log reads:
try: SELECT dbo.WsParameterReadf('FPF_START_TIME') (.GetValue())
catch: Exception calling "GetValue" with "1" argument(s): "No data exists for the row/column.".Exception.Message
out:
When I manually run what it's running (over same ODBC DSN) I get a single row result...
Attempt 2:
function getParam($Parameter)
{
$RepoConStr = "DSN=${env:WSL_META_DSN}; Integrated Security=true;"
$RepoCon = New-Object System.Data.Odbc.OdbcConnection($RepoConStr)
$cmd = New-Object System.Data.Odbc.OdbcCommand
$RepoCon.open()
$cmd.CommandTimeout = 120
$cmd.CommandType = "StoredProcedure"
$cmd.CommandText = "WsParameterReadf '$Parameter'"
$cmd.Connection = $RepoCon
$outParam = New-Object System.Data.Odbc.OdbcParameter
$outParam.ParameterName = "@Result"
$outParam.Direction = "ReturnValue"
$outParam.O
... keep reading on reddit β‘While working on combiler, I tend to get distracted by another idea on how to compact one circuit or even get ideas for completely new ones - thanks to u/Halke1986 in particular :p
The other day, he presented a prototype for a fast base 2 logarithm function and we tinkered with it until the following super compact version was found:
Blueprint https://pastebin.com/K85X7rcy
It's really just this small, 1 decider combinator and 2 constant combinators acting as a ROM. The principle behind it is rather general, so allow me to explain how it works:
Fist, take a look at the graph of y=log_2(x) and the integer version, which just computes y=floor(log_2(x)), the latter of which I'll call ilog2 in the rest of this writeup
https://preview.redd.it/wh10rx99xr331.png?width=401&format=png&auto=webp&s=44ff2f3168bc929d5a58aed1a507384e413d6b72
The important feature of this function that we will exploit is that it's monotonic and that it's value range is really small:
Now consider what the following decider combinator does:
[100 < Black then Black += 1]
It seems simple:
Now, consider what happens if you have two of those in parallel, but with different numbers, say 100 and 200:
I hope you start to see where we're going with this: each such combinator is a prototypic monotonic function, which simply
... keep reading on reddit β‘Is it always possible to find a pair of functions that satisfy this condition? And if so how can I find them?
This question popped up when watching Introducing Green's Functions for Partial Differential Equations (PDEs) 3:15.
Any guidance would be greatly appreciated, thanks in advance.
I have the following code
returnPolygon.h
:
double *add(double *in1, double *in2, int L);
returnPolygon.cpp
:
#include "returnPolygon.h"
double *add(double *in1, double *in2, int L)
{
double *res = new double[L];
for (int i = 0; i < 5; i++) {
res[i] = in1[i] + in2[i];
}
return res;
}
callReturnPolygon.m
:
function S = callReturnPolygon
%#codegen
if coder.target('MATLAB')
else
coder.updateBuildInfo('addSourceFiles','returnPolygon.cpp');
coder.cinclude('returnPolygon.h');
res=[0 0];
res = coder.ceval('add', [1,2,3], [4,5,6], 3);
S=sum(res);
sprintf('sum: %s', char(num2ascii(S,1)))
end
But I get the error
codegen -config:dll callReturnPolygon -report
??? C function calls always return scalar values but a non-scalar value is expected here.
Error in ==> callReturnPolygon Line: 8 Column: 11
Code generation failed: View Error Report
Error using codegen
Could anyone help?
EDIT
THe Matlab docs mentioned that coder.ceval
can't return arrays. So I tried to solve the problem using Structures instead:
returnPolygon.h
:
struct returnPolygon
{
double *x;
double *y;
returnPolygon(double *in1, double *in2);
};
returnPolygon.cpp
:
#include "returnPolygon.h"
returnPolygon::returnPolygon(double *in1, double *in2) {
this->x = in1;
this->y = in2;
}
main.cpp
:
#include "returnPolygon.h"
#include <iostream>
using namespace std;
int main()
{
double xarr[5] = { 1,2,3,4,5 };
double yarr[5] = { 21,22,23,24,25 };
returnPolygon rp = returnPolygon(xarr, yarr);
std::cout << "x: " << std::endl;
for (int i = 0; i < 5; i++) {
std::cout << rp.x[i] << std::endl;
}
std::cout << "y: " << std::endl;
for (int i = 0; i < 5; i++) {
std::cout << rp.y[i] << std::endl;
}
return 0;
}
When I run the above code in Visual Studio, it compiles with no errors and correctly displays the values. But when I try the Matlab code
function S = callReturnPolygon1 %#codegen
S=struct('x',{0},'y',{0} );
if coder.target('MATLAB')
else
coder.updateBuildInfo('addSourceFiles','returnPolygon.cpp');
coder.cinclude('returnPolygon.h');
S = coder.ceval('returnPolygon', [1,2,3], [4,5,6]);
sprintf('sum: %s', char(num2ascii(S.x,1)))
end
end
and codegen -config:lib callReturnPolygon1 -report
, I get the error
So first off, should I be computing βg and βf as respective gradients of each vectors? Or as a dot product ( ex: β β f) ?
Next, how would I go about doing this in a clean manner? I have about 6 other similar problems where two arbitrary scalar functions or arbitrary vector functions are given and I'm supposed to prove that LHS = RHS
Please note that this site uses cookies to personalise content and adverts, to provide social media features, and to analyse web traffic. Click here for more information.