Cannot calculate Conv1D backprop gradients correctly

I’m a beginner trying to understand the backpropogation for Conv1D. I’m implementing it and comparing my gradients with pytorch’s gradients. However, the backprop step seems to be wrong. I have posted the full implemented class.

class Conv1D:     def __init__(self, input_channel, output_channel, kernel_size, stride):         self.input_channel = input_channel         self.output_channel = output_channel         self.kernel_size = kernel_size         self.stride = stride         self.W = np.random.normal(0, 1, [output_channel, input_channel, kernel_size])         self.b = np.random.normal(0, 1, [output_channel])         self.dW = np.zeros(shape=self.W.shape)         self.db = np.zeros(shape=self.b.shape)         self.dx = np.zeros(shape=self.b.shape)         self.input = np.array([])      def forward(self, x):         output_width = int(np.floor(len(x[0][0])-self.kernel_size)/self.stride) + 1         y = np.zeros(shape=[len(x), self.output_channel, output_width])         self.input = np.copy(x)         for i in range(len(x)):             for j in range(self.output_channel):                 k_ = 0                 for k in range(output_width):                     input_piece = x[i, :, k_:k_+self.kernel_size]                     y[i][j][k] = np.sum(np.multiply(input_piece, self.W[j])) + self.b[j]                     k_ += self.stride         return y      def backward(self, dl):         output_width = int(np.floor(len(dl[0][0])-self.kernel_size)/self.stride) + 1         self.dW = np.zeros(shape=self.W.shape)         self.db = np.zeros(shape=self.b.shape)         self.dx = np.zeros(shape=self.input.shape)         for i in range(len(dl)):             for j in range(self.output_channel):                 k_ = 0                 for k in range(output_width):                     input_piece = self.input[i][:, k_:k_+self.kernel_size]                     self.dx[i][:, k_:k_+self.kernel_size] += dl[i][j][k] * self.W[j]                     self.dW[j] += dl[i][j][k] * input_piece                     self.db[j] += dl[i][j][k]                      k_ += self.stride         return self.dx        def __call__(self, x):         return self.forward(x) 

I would really appreciate if someone could find my mistake.

Is Mathematica calculating Lagrangian correctly?

The following Lagrangian is available: Lagrangian

Here $ \omega(t)$ is the angular velocity of the body; $ J(t,\theta(t))$ – a variable moment of inertia of the body, depending on $ t$ and on $ \theta(t)$ ; $ m(\omega(t))$ – a hypothetical change in body weight (does not have a physical meaning, this is necessary to study the equation);$ G_g$ -acceleration of gravity;$ P$ -vector of the center of mass, depending on the time and angle of rotation of the body in space.

The question is as follows. When we draw up the Euler-Lagrange equation, we fit the Lagrangian into the following structure:

Euler-Lagrange equations

In Mathematics, there is a code that, in theory, should calculate the Euler-Lagrange equation according to the Lagrangian:

L = \[Omega][t]^2 J[t, \[Theta][t]] - (m[\[Omega][t]]) (Subscript[G, g]) P[t, \[Theta][t]]     D[D[L, \[Omega][t]], t] - D[L, \[Theta][t]] 

What confuses me is that the second term in the last formula contains the derivative with respect to the generalized coordinate, which also changes in time, and the generalized coordinate and its speed also enter into the term of kinetic energy and potential energy.

Is the result obtained in the Mathematica by this code correct?

Correctly connecting Web App with MySiteHost in case of multiple mapping

Current situation:

  • there is a classic SP application (site collection created eg according to Team Site template) – default AAM is https: //intranet.xxx.local
  • there is an application for MySite (created from MySiteHost template) – default AAM is https: //mysite.xxx.local
  • there are 2 applications exactly like this, so when user goes to https: //intranet.xxx.local and clicks eg. to the SharePoint heading (top left corner), redirecting it to https: //mysite.xxx.local

Required functionality:

  • it is necessary to extend the application, because it should also be accessible from the Internet
  • the “normal” SP application will then be available for example. on url – https: //sp.xxx.sk
  • if the user goes from intranet, then https: //intranet.xxx.local, the link to “mysite” should be https: //mysite.xxx.local
  • if the user goes from internet, then https: //intranet.xxx.local, the link to “mysite” should be https: //mysite.xxx.local

Questions:

  • I understand correctly that it is enough to extend the wep app https: //intranet.xxx.local and https: //mysite.xxx.local and when I go from the Internet I will have correctly displayed URLs https: //sp.xxx.sk and https: //my.xxx.sk? Or is there anything else to be adjusted?
  • Do I need additional Search Service settings when I use search?

How to correctly negate a predicate bounded by some quantifiers?

this is a problem which was asked in GATE CS 2010.

This is question statement:
Q:
Suppose the predicate F(x, y, t) is used to represent the statement that person x can fool person y at time t. which one of the statements below expresses best the meaning of the formula ∀x∃y∃t(¬F(x, y, t))?

Options:
A: Everyone can fool some person at some time.
B: No one can fool everyone all the time.
C: Everyone cannot fool some person all the time.
D: No one can fool some person at some time.

According to my solution:
If F(x): person x can fool person y at time t.
Then
$ \forall$ x $ \exists$ y $ \exists$ t ( ¬F( x, y, t ) )
is same as “Not all person x can fool some person y at some time t. which can be rewritten as “No one can fool some person at some time”.
Hence Option D must be the correct one.
However I am wrong.

How to approach these type of problems.

Correctly differentiate wrt product of variables

I have a function f(x) for which I would need to differentiate and then evaluate it to some product x = y*z. Naively, Mathematica does not accept:

D[f[y z], y z] 

Now, I can somewhat force it by using a rule like so:

D[f[x], x] /. x -> y z 

Now, the problem is that the substitution, for example

rule = f[y z] -> y z D[f[x], x] /. x -> y z /. rule 

is not performed at all. Here, I would of course expect the answer to be 1. How can I make this work as intended?

Is my notion of Topology correctly encoded in Agda?

Here, I’m trying to encode the notion of Topology. I was wondering if it’s correctly done via a “Propositions as Types” interpretation.

module Topology where  open import Data.Product public using (Σ; Σ-syntax; _×_; _,_; proj₁; proj₂; map₁; map₂) open import Data.Sum  -- Goal: encode the notion of Topology: -- -- Let X be a non-empty set. A set τ of subsets of X -- is said to be a topolgy on X if: --  -- 1. X and the empty set, Ø, belong to τ -- 2. The union of any (finite or infinite) number of sets -- in τ belongs to τ -- 3. The intersection of any two sets in τ belongs to τ -- -- The pair (X,τ) is called a topological space.  -- We can express a notion of a subset `{ x : A | P(x) }`  -- as `Σ[ x ∈ A ] (P x)` (with notion that P is mere  -- proposition in mind).  subset : (X : Set) → (P : (X → Set)) → Set subset X P =   Σ[ a ∈ X ] (P a)  -- If subset is described by a predicate that's describing an -- inhabited proposition for every **element** in X, a set of subsets -- must describe a predicate that's describing an inhabited -- proposition for every **predicate** on X setOfSubsets : (X : Set) → (ℙ : (X → Set) → Set) → Set₁ setOfSubsets X ℙ =   Σ[ P ∈ (X → Set) ]   (ℙ P)  data Ø : Set where data ⊤ : Set where   ⋆ : ⊤  -- Identity predicate P-id : {X : Set} → (X → Set) P-id = λ{_ → ⊤}  -- Zero predicate P₀ : {X : Set} → (X → Set) P₀ = λ{_ → Ø}  isTopology : (X : Set) → (τ : (X → Set) → Set) → Set₁ isTopology X τ =   Σ[ P ∈ (X → Set) ]   Σ[ _ ∈ τ P ]   Σ[ _ ∈ τ P-id ]   Σ[ _ ∈ τ P₀ ]   Σ[ _ ∈ (∀ (A B : X → Set) → (τ A) → (τ B) → (τ (λ x → A x ⊎ B x))) ]   Σ[ _ ∈ (∀ (A B : X → Set) → (τ A) → (τ B) → (τ (λ x → A x × B x))) ]   ⊤ 

Active Directory Import not working correctly

I have configured AD Import on 2013 instance, but it seems that it doesn’t work correctly. New entries in specified OUs are not imported into UPS. I have checked the logs and there are no errors thrown by profile sync. Below is an example:

Active Directory UPS

As you can see everything seems to be correctly configured, yet the profile is not created in UPS and workflow throws an error when being initiated by a user presented above:

WF

Any ideas?

people picker not resolving names correctly

We have our sharepoint server in a domain named DMZ. Our AD users are in another domain, say domain ACME. In the DMZ domain we also have external SP users. All of a sudden the people picker will resolve the DMZ names properly but not the ACME names.

If I open the people picker user search, only DMZ users show up. I have also verified there is still trust between the servers/domains

Any help is appreciated!

`sudo` is not using the right binary, even when $PATH is correctly passed

I am trying to run a Pipenv python instance as root. When not run as root:

(myenv) $   python script.py 

the Pipenv python is correctly used. However, when run as root with sudo:

(myenv) $   sudo python script.py 

the system default python at /usr/bin/python is used instead. After some searching, I found the -E option for sudo. However, with

(myenv) $   sudo -E python script.py 

it still uses /usr/bin/python, even though sudo -E echo $ PATH gives the same as echo $ PATH, so the -E option works fine; however, sudo -E which python continues to give /usr/bin/python! It is not a permissions or access problem because the full path to the Pipenv python works fine. Why is the wrong binary being used even though $ PATH is set correctly?