Minimising an Integrated Relative Entropy Functional

Suppose I am given

  • A probability distribution on $ \mathbf R^d$ , with density $ \pi (x)$ .
  • A family of transition kernels $ \{ q^0 (x \to \cdot) \}_{x \in \mathbf R^d}$ on $ \mathbf R^d$ , with densities $ q^0 (x \to y)$ .

I now want to find a new family of transition kernels $ \{ q^1 (x \to \cdot) \}_{x \in \mathbf R^d}$ such that

  • $ q^1$ is in detailed balance with respect to $ \pi$ , i.e.

\begin{align} \pi (x) q^1 ( x \to y ) = \pi (y) q^1 ( y \to x) \end{align}

  • $ q^1$ are as close as possible to $ q^0$ in KL divergence, averaged across $ x \sim \pi$ .

To this end, I introduce the following functional

\begin{align} \mathbb{F} [ q^1 ] &= \int_{x \in \mathbf R^d} \pi (x) \cdot KL \left( q^1 (x \to \cdot ) || q^0 (x \to \cdot ) \right) dx\ &= \int_{x \in \mathbf R^d} \int_{y \in \mathbf R^d} \pi (x) \cdot q^1 (x \to y) \log \frac{ q^1 (x \to y) }{ q^0 (x \to y) } \, dx dy \ &= \int_{x \in \mathbf R^d} \int_{y \in \mathbf R^d} \pi (x) \cdot \left\{ q^1 (x \to y) \log \frac{ q^1 (x \to y) }{ q^0 (x \to y) } – q^1 (x \to y) + q^0 (x \to y) \right \} \, dx dy. \end{align}

I thus wish to minimise $ \mathbb{F}$ over all transition kernels $ \{ q^1 (x \to \cdot) \}_{x \in \mathbf R^d}$ satisfying the desired detailed balance condition. Implicitly, there are also the constraints that the $ q^1$ are nonnegative and normalised.

I would like to solve this minimisation problem, or at least derive e.g. an Euler-Lagrange equation for it.

Currently, I can show that the first variation of $ \mathbb{F}$ is given by

\begin{align} \left( \frac{d}{dt} \vert_{t = 0} \right) \mathbb{F} [q^1 + t h] = \int_{x \in \mathbf R^d} \int_{y \in \mathbf R^d} \pi (x) \cdot \log \frac{ q^1 (x \to y) }{ q^0 (x \to y) } \cdot h (x, y) \, dx dy. \end{align}

Moreover, my constraints stipulate that any admissible variation $ h$ must satisfy the following two conditions:

  1. $ \forall x, y, \quad \pi (x) h (x, y) = \pi (y) h (y, x)$
  2. $ \forall x, \quad \int_{y \in \mathbf R^d} h (x, y) dy = 0$

I have not been able to translate these conditions into an Euler-Lagrange equation. I acknowledge that since the functional involves no derivatives of $ q^1$ , the calculus of variations approach may be ill-suited. If readers are able to recommend alternative approaches, this would also be appreciated. Anything which would allow for a more concrete characterisation of the optimal $ q^1$ would be ideal.

CSS position Absolute and position Relative clashing with Keyframe Animations (In React Project)

Look at .h1-div (Parsa Ventures Text)

If I make the div position relative, the animation works, but the h1 moves to the bottom of the screen below the content.

If I make the div position absolute, its very responsive and is positioned where it needs to be, but animation doesn’t work.

I need the responsiveness and the animation both to work on the h1.

enter image description here

(Imports and state not included in code)

import React from 'react' function App() {     return (         <>             <Home />          </>     ) }  export default App   

Home Component:

class Home extends React.Component {     render() {         return (             <div id="mainDiv" style={{ backgroundColor: '#FFFDF8', overflow: 'auto', width: '100%', height: 'auto',  position: 'relative'}}>                      <div className="h1-div">                         <h1>Parsa Ventures</h1>                       </div>                     <img src={leftTree} alt="a"  id="leftTree"/>                     <img src={swing} alt="a"  className="swing" id="swing"/>                    <img src={mSwing} alt="a" className="m-swing"  id="mSwing" />                     <img src={leftRope} alt="a"  className="left-rope" id="leftRope"/>                     <img src={rightTree} alt="a" className="right-tree" id="rightTree"/>                       <div className="pillow-a"  >                         <img src={pillowA} alt="" className={this.state.pillow ? 'enter' : 'leave'} id="p"/>                         <a href="#" onMouseEnter={this.handleEnter} onMouseLeave={this.handleLeave} id="p-a">About</a>                     </div>                     <div className="pillow-c"  >                         <img src={pillowA} alt="" className={this.state.pillow ? 'enter' : 'leave'} id="p"/>                         <a href="#" onMouseEnter={this.handleEnter} onMouseLeave={this.handleLeave} id="p-a">Contacts</a>                     </div>                     <div className="pillow-p"  >                         <img src={pillowA} alt="" className={this.state.pillow ? 'enter' : 'leave'} id="p"/>                         <a href="#" onMouseEnter={this.handleEnter} onMouseLeave={this.handleLeave} id="p-a">Projects</a>                     </div>                     <div className="pillow-m-a"  >                         <img src={pillowA} alt="" />                         <a href="#">About</a>                     </div>                     <div className="pillow-m-c">                     <a href="#">Contacts</a>                         <img src={pillowA} alt="" />                         </div>                     <div className="pillow-m-p"  >                     <a href="#">Projects</a>                         <img src={pillowA} alt="" />                      </div>              </div>         )     } }  export default Home 

SCSS:

.h1-div{      position: absolute;            width: 28%;     height:1%;     left: 67%;     top: 30%;         animation-name: pvh1;         animation-duration: 3s;         animation-fill-mode: forwards;          h1{             font-size: 3.7vw;             color: #38AFC9;             text-shadow: 6px 6px 0px rgba(255, 210, 225, 0.84);         }           }       @keyframes pvh1 {         0% {right: -25%; bottom: 50%;}         75% {right: 8.75%; bottom: 50%;}         100% {right: 5%; bottom: 50%;}     }    img{         max-width: 100%; }  .right-tree{     position: relative;     left: 40%;      max-width: 60%;  }  .swing{  position: absolute; left: 4%; top: 29.5%; width: 34.3%; height: auto; }  .left-rope{     position: absolute;     left: 4.6%;     top: 45%;     width: 3.7%;     height: auto;     z-index: 1; } 

Position Aboslute queda debajo de position relative

Tengo un problema con un meno con posicion absoluta funciona todo bien pero a la hora de desplegarlo en componentes de tipo ‘col, col-md-2, col-4, etc’ de bootstrap, este menu queda debajo de dicho componentes.

introducir la descripción de la imagen aquí

al analizar el css, veo que tienen ‘position: relative;’, al desactivar el position funciona correctamente, pero quisiera saber si no existe otra forma, ya que no me es factible tener que quitar la posicion relativa a todos esos componentes.

$\pi_1$ action on relative homotopy groups $\pi_n(X,A)$

It is known that there is a natural $ \pi_1(X,x)$ action on $ \pi_n(X,x)$ which also induces a bijection $ \pi_n(X,x)/\pi_1(X,x) \cong [S^n, X]$ .

Now, let $ (X,A)$ be a pair of path-connected spaces and $ x\in A$ . We also have a $ \pi_1(A,x)$ action on the relative homotopy group $ \pi_n(X,A,x)$ .

Is there any similar description for the quotient $ \pi_n(X,A,x)/ \pi_1(A,x)$ ?

I guess it might be $ [(D^n,S^{n-1}), (X,A)]$ , the homotopy class of continuous maps of space pairs, since I notice that $ \pi_n(X,A, x)$ can be defined as $ [(D^n, S^{n-1},pt), (X,A,x)]$ .

But maybe I was wrong, as I cannot find it in any reference.

Relative path return 404 on ubuntu

I developed a small nodejs application and I’m facing a weird issue. Essentially, I’m using ExpressJS and I configured the static files, such as (js, css, etc…) to that path:

app.use(express.static(path.join(__dirname, "../public"))); 

when I run the application on windows I have no problem, all the css and js file are loaded correctly, eg:

<!-- STYLE CSS --> <link rel="stylesheet" href="/css/bootstrap.min.css"> <link rel="stylesheet" href="/css/style.css"> <link rel="stylesheet" href="/css/custom-style.css"> 

but when I run the app on ubuntu I get the 404 error.

I suspect there is something that doesn’t works on the double dots ../, infact I had the following loader first:

require('dotenv').config({     path: `./env-files/$  {process.env.NODE_ENV || 'development'}.env` }); 

and I changed it to get it working.

require('dotenv').config({     path: __dirname + '/env-files/' + `$  {process.env.NODE_ENV || 'development'}.env` }); 

Perhaps ubuntu doesn’t support the above syntax?

The structure of the app is:

app.js      config           environment.js      public            css           js 

the file environment.js load the folder public

How to print the relative url or node id for each referenced node in twig?

I am using paragraphs to render a number of nodes on a page. The nodes are obtained through an entity reference field called ‘field_nodeslist’ in my cards paragraph type. The cards are then rendered using a custom view layout.

Here is a snippet of my view layout:

<a href="????">    <h3>{{ content.top_region|strip tags}}</h3>    <p>{{ content.middle_region }}</p> </a> 

The problem I am having is printing the relative path for each referenced node. I have tried the following twig commands but have not any success so far:

<a href="{{ url }}"> <a href="{{ uri }}"> <a href="{{ node.id }}"> <a href="{{ link }}"> <a href"{{ content.field.0['#url'] }}"> 

The following allows me to manually specify the node id in twig however that’s not what I am looking for:

<a href="{{ path('entity.node.canonical', {'node': 6 }) }}"> 

Any ideas?

Conditional formatting cells with multiple conditions and relative references over a range

I have a Google spreadsheet with arbitrary data. Three adjacent columns (let’s say A, B and C) have been set up with Data Validation to only allow values from 1 to 10.

I’m looking for a way to validate that if all three columns of a single row (e.g. A4, B4 & C4) have a value of 10, all three cells should get formatted differently, let’s say a different background color for the sake of simplicity.

This formatting should apply to an entire range from A/B/C1 to A/B/C300, and here lies the problem.

I’ve tried many ways to do this with data validation, built-in functions and conditional formatting, but other than going row by row applying the formatting, I haven’t found an actually effective way to do this. Had to resort to the script editor and write a function called when onEdit() gets triggered, but this is slow and the coloring can actually be seen being applied when the code triggers because each row needs to be checked individually.

Is there any way to do this without having to resort to scripting, and without having to do it row by row?

ARRAYFORMULA + QUERY + IMPORTRANGE – Final cell reference in IMPORTRANGE is acting like it’s absolute when I need it to be relative

I know I’m chaining a lot together here, but it’s SO close to functional. Here is my formula with the doc address altered for privacy.

=ARRAYFORMULA(IF(ISBLANK($ AE$ 3:$ AE),(query(importrange(“https://docs.google.com/spreadsheets/d/XXXDkgregmq16N91iBOjKcMH3B74w9PoEExrHRWGdaP4/edit#gid=1834499049″,”Brite Fills Lot Truncation!A1000:H”),”select Col2, Col6 Where Col1= ‘”&(’14 oz Bottles’!$ G3:$ G)&”‘”))))

In short, I want this formula to auto-fill into a sheet that collects responses for a Google Form. It cross references another sheet and returns data based on the value of the G column in my current sheet. The only issue is what is in bold above. This function ONLY returns the value that matches $ G$ 3 in my current sheet, acting as if it’s an absolute cell reference. I want it to be relative so that it fills each line based on whatever value is in the G cell on that row.

I would be thankful for any insight!