text:
The Deffuant model on \Z with higher-dimensional opinion spaces

# The Deffuant model on \Z with higher-dimensional opinion spaces

## Abstract

When it comes to the mathematical modelling of social interaction patterns, a number of different models have emerged and been studied over the last decade, in which individuals randomly interact on the basis of an underlying graph structure and share their opinions. A prominent example of the so-called bounded confidence models is the one introduced by Deffuant et al.: Two neighboring individuals will only interact if their opinions do not differ by more than a given threshold . We consider this model on the line graph and extend the results that have been achieved for the model with real-valued opinions by considering vector-valued opinions and general metrics measuring the distance between two opinion values. As in the univariate case there turns out to exist a critical value for at which a phase transition in the long-term behavior takes place, but depends on the initial distribution in a more intricate way than in the univariate case.

## 1 Introduction

Consider a simple graph and assume the vertex set to be either finite or countably infinite with bounded maximal degree. The vertices are assumed to represent individuals and each of them is assigned an opinion value. The edges in – being connections between individuals – are understood to embody the possibility of mutual influence. For that reason it is no restriction to focus on connected graphs, as the components could be treated individually otherwise. From different directions including social sciences, physics and mathematics, there has been raised interest in various models for what is called opinion dynamics and deals with the evolution of such a system under a given set of interaction rules. These models are qualitatively different but share similar ideas, see [1] for an extensive survey.
The Deffuant model (introduced by Deffuant et al. [2]) is one of those and features two parameters, the confidence bound and the convergence parameter , shaping the willingness to approach the other individual’s opinion in a compromise. There are two types of randomness in the model: One is the random initial configuration, meaning that at time the vertices are assigned identically distributed opinions, the other are the random encounters thereafter. Serving as a regime for the latter, all the edges in are assigned unit rate Poisson processes, which are independent of one another and the initial configuration. Whenever a Poisson event occurs on an edge, the corresponding adjacent vertices interact in the manner described below. Just like in most of the analyses of this model, we will consider i.i.d. initial opinion values, but comment on how the considerations can be generalized.

By we denote the opinion value at vertex at time . The current value will not change until at some future time a Poisson event occurs at one of the edges incident to , say , which then might cause an update. Let and be the two opinion values of and , just before this happens.

If these opinions lie at a distance less than the confidence bound from one another, they will symmetrically take a step, whose size is scaled by , towards a common compromise, if not they stay unchanged. Although there is a section on vector-valued binary opinions in the original paper by Deffuant et al. [2], using a different model, the Deffuant model with the interaction rule just described was originally only defined for opinions being real-valued and the absolute value as notion of distance. In order to broaden the original scope of this model to vector-valued opinions, the natural replacement for the absolute value is the Euclidean distance

 d(x,y)=∥x−y∥2=√(x−y)2, for all x,y∈Rk.

Given this measure of distance, the rule for opinion updates in the Deffuant model reads as follows:

 ηt(u)={a+μ(b−a)if ∥a−b∥2≤θ,aotherwise

and similarly

 ηt(v)={b+μ(a−b)if ∥a−b∥2≤θ,botherwise.

Note that choosing gives back the original model.

As the assumptions on the graph force to be countable, there will almost surely be neither two Poisson events occurring simultaneously nor a limit point in time for the Poisson events on edges incident to one fixed vertex. Yet in addition to that there is a more subtle issue in how the simple pairwise interactions shape transitions of the whole system in the infinite setting, putting it into question whether the whole process is well-defined by the update rule (LABEL:dynamics). For infinite graphs with bounded degree, however, this problem is settled by standard techniques in the theory of interacting particle systems, see Thm. 3.9 on p. 27 in [9].

One of the most natural questions in this context – motivated by interpretations coming from social science – seems to be, under what conditions the individual opinions will converge to a common consensus in the long run and under what conditions they are going to split up into groups of individuals holding different opinions instead. In this regard let us define the following types of scenarios for the asymptotic behavior of the Deffuant model on a connected graph as time tends to infinity:

###### Definition 1
1. No consensus
There will be finally blocked edges, i.e. edges s.t.

 ∥ηt(u)−ηt(v)∥2>θ,

for all times large enough. Hence the vertices fall into different opinion groups.

2. Weak consensus
Every pair of neighbors will finally concur, i.e.

 limt→∞∥ηt(u)−ηt(v)∥2=0.
3. Strong consensus
The value at every vertex converges, as , to a common limit , where

 l={the average of the initial opinion values,if G is finiteEη0,if G is infinite

and denotes the distribution of the initial opinion values.

The first analyses of the Deffuant model and similar opinion dynamics were strongly simulation-based and thus confined to a finite number of agents. In [3] for example, Fortunato simulated the long-term behavior of the Deffuant model on four different kinds of finite graphs: Two deterministic examples – the complete graph and the square lattice – as well as two random graphs – those given by the Erdős-Rényi model as well as the Barabási-Albert model. He found strong numerical evidence that, given initial opinions that are independently and uniformly distributed on , a confidence threshold less than leads to a fragmentation of opinions, leads to a consensus – irrespectively of the underlying graph structures that were considered. Later, the simulation studies were extended to the generalization of the Deffuant model to higher-dimensional opinion values, see for instance [10].

There are however crucial differences between the interactions on a finite compared to an infinite graph. In the finite case, statements about consensus or fragmentation tend to be valid not with probability but at best with a probability that is close to : In the standard case of i.i.d.  initial opinions for example, any non-trivial confidence bound, i.e. , can lead to either consensus or fragmentation depending on the initial values and the order of interactions. Furthermore, the fact that the dynamics (LABEL:dynamics) preserves the opinion average of two interacting agents implies that strong consensus follows from weak consensus on a finite graph. This does not have to hold in an infinite setting.

The first major step in terms of a theoretical analysis of the model on an infinite graph was taken by Lanchier [7], who treated the model on the line graph – similarly with an i.i.d.  configuration. His main result implies that there is a phase transition at from a.s. no consensus to a.s. weak consensus. These findings were reproven and slightly sharpened by Häggström [4] to the statement of Theorem 2.1 below, using a non-random pairwise averaging procedure on which he termed Sharing a drink (SAD) to get a workable representation of the opinion values at times .

Using his line of argument, the results were generalized to initial distributions other than by Häggström and Hirscher [5] as well as Shang [12], independently. In [5], the analysis of the Deffuant model was in addition to that extended to other infinite graphs, namely higher-dimensional integer lattices and the infinite cluster of supercritical i.i.d. bond percolation on these lattices.

In this paper we stay on the infinite line graph, that is the integer numbers with consecutive integers forming an edge. The direction in which we want to broaden the analysis is – as already indicated – the generalization of the Deffuant model on to vector-valued opinions. In Section 2, we give a brief summary of the results for real-valued opinions derived in [5], together with the key ideas and tools that were used there.

In Section 3 we establish corresponding results for the case of higher-dimensional opinions sticking, as indicated above, to the Euclidean norm as measure of distance between the opinions of interacting agents. Actually, the main results (Theorem 3.3 and 3.4) in this section match the statement for real-valued opinions (Theorem 2.2) in the sense that the radius of the initial distribution as well as the largest gap in its support – the generalized definitions of which you will find in Definition 2 and 6 – determine the critical value for at which there is a phase transition from a.s. no consensus to a.s. strong consensus. While the concept of a distribution’s radius straightforwardly transfers to higher dimensions, the one of a gap has to be properly redefined and investigated. Doing this, we can in fact characterize the support of the opinion values at times , see Proposition 3.3. Even though we will throughout the paper consider the initial opinions to be i.i.d. it is mentioned in the remark after Theorem 3.4, how the arguments can be extended to particular dependent initial configurations in the way it was done in [5].

Section 4 finally deals with the generalization of the Deffuant model to distance measures other than the Euclidean, in both one and higher dimensions. We pin down properties a general metric (used to determine whether two opinions are close enough to compromise or not) needs to have in order to allow for the results from Section 3 to be preserved (see Theorem 4.5 and 4.6). Examples are given to illustrate the necessity of the requirements imposed on .

At this point it should be mentioned that the vectorial model that was already introduced in the original paper by Deffuant et al. [2] and analyzed quite recently by Lanchier and Scarlatos [8] does not fit the general framework of this paper. Unlike all opinion dynamics considered here, its update rule is different from (LABEL:dynamics) and especially not average preserving, leading to substantial qualitative differences.

## 2 Background on the univariate case

###### Theorem 2.1 (Lanchier)

Consider the Deffuant model on the graph , where with i.i.d. unif initial configuration and fixed .

1. If , the model converges almost surely to strong consensus, i.e. with probability we have: for all .

2. If however, the integers a.s. split into (infinitely many) finite clusters of neighboring individuals asymptotically agreeing with one another, but no global consensus is approached.

Accordingly, for independent initial opinions that are uniform on , the critical value equals , with subcritical values of leading a.s. to no consensus and supercritical ones a.s. to strong consensus. The case when the confidence bound actually takes on value is still an open problem. The ideas Häggström [4] used to reprove the above result were adapted to accommodate more general univariate initial distributions leading to a similar statement for all such having a first moment , see Thm. 2.2 in [5], which reads as follows:

###### Theorem 2.2

Consider the Deffuant model on with real-valued i.i.d. initial opinions.

1. Suppose the initial opinion of all agents follows an arbitrary bounded distribution with expected value and being the smallest closed interval containing its support. If does not lie in the support, let be the maximal, open interval such that lies in and . In this case let denote the length of , otherwise set .

Then the critical value for , where a phase transition from a.s. no consensus to a.s. strong consensus takes place, becomes . The limit value in the supercritical regime is .

2. Suppose the initial opinions’ distribution is unbounded but its expected value exists, either in the strong sense, i.e. , or the weak sense, i.e. . Then the Deffuant model with arbitrary fixed parameter will a.s. behave subcritically, meaning that no consensus will be approached in the long run.

The situation at criticality is unsolved with the exception of the case when the gap around the mean is larger than its distance to the extremes of the initial distribution’s support. Given this condition, however, the following proposition (which is Prop. 2.4 in [5]) settles the question about the long-term behavior for critical :

###### Proposition 2.1

Let the initial opinions be again i.i.d. with being the smallest closed interval containing the support of the marginal distribution, and the latter feature a gap of width around its expected value .

At criticality, that is for , we get the following: If both and are atoms of the distribution , i.e.  and , the system approaches a.s. strong consensus. However, it will a.s. lead to no consensus if either or .

Since the same line of reasoning was used in both [4] and [5] to derive the results we just stated, it is worth taking a closer look on the key concepts involved, especially as they will be the foundation for most of the conclusions drawn in the upcoming sections.

The presumably most central among these is the idea of flat points. If , a vertex is called -flat to the right in the initial configuration if for all :

 1n+1v+n∑u=vη0(u)∈[Eη0−ε,Eη0+ε]. (2)

It is called -flat to the left if the above condition is met with the sum running from to instead. Finally, is called two-sidedly -flat if for all

 1m+n+1v+n∑u=v−mη0(u)∈[Eη0−ε,Eη0+ε]. (3)

However, in order to understand how vertices being one- or two-sidedly -flat in the initial configuration play an important role in the further evolution of the configuration another concept is indispensable, namely the non-random pairwise averaging procedure Häggström [4] called Sharing a drink (SAD).

Think of glasses being placed at all integers, the one at site being brimful, all others empty. Just as in the Deffuant model, neighbors interact and share, but this time without randomness and confidence bound. In other words, we start with the initial profile , given by and for all , and a finite sequence of edges along which updates of the form (LABEL:dynamics) are performed, i.e. for the profile after step and we get by

 ξn+1(u)=(1−μ)ξn(u)+μξn(u+1),ξn+1(u+1)=μξn(u)+(1−μ)ξn(u+1); (4)

all other values stay unchanged.

Elements of that can be obtained in such a way are called SAD-profiles. The crucial connection to the Deffuant model is that the opinion value at any given time can be written as a weighted average of values at time with weights given by an SAD-profile (see La. 3.1 in [4]). The fact that all SAD-profiles share certain properties (the most important being unimodality) renders it possible to derive characteristics of the future evolution of the Deffuant dynamics given the initial configuration. For instance, the opinion value at a two-sidedly -flat vertex in the initial configuration can never move further than away from the mean (see La. 6.3 in [4]).

These two vital ingredients – flat points and SAD-profiles – of the line of argument in [4] and Sect. 2 in [5] can be adapted in order to analyze the Deffuant model with vector-valued opinions, as we will see in the following section.

## 3 Deffuant model with multivariate opinions and the Euclidean norm as measure of distance

Having characterized the long-term behavior of the Deffuant dynamics on starting from a general univariate i.i.d. configuration, the next step of generalization with regard to the marginal initial distribution is, as indicated in the introduction, to allow for vectors instead of numbers to represent the opinions. Like in the univariate case, we want the initial opinions to be independent and identically distributed, just now with some common distribution on . This will ensure ergodicity of the setting (with respect to shifts) as before.

In this section we will consider to be equipped with the Borel -algebra generated by the Euclidean norm, denoted by .

###### Definition 2

If the distribution of has a finite expectation, define its radius by

 Missing or unrecognized delimiter for \big

where denotes the closed Euclidean ball with radius around . Note that the radius of an unbounded distribution is infinite.

The notion of -flatness easily translates to the new setting by just replacing the intervals by balls: If , a vertex is called -flat to the right in the initial configuration if for all :

 1n+1v+n∑u=vη0(u)∈B[Eη0,ε], (5)

similarly for -flatness to the left and two-sided -flatness – compare with (2) and (3).

With these notions in hand we can state and prove a higher-dimensional analogue of Theorem 2.2, valid for initial distributions whose support does not feature a substantial gap around the mean. The proof of this result will be a fairly straightforward adaptation of the methods for the univariate case indicated in Section 2. In contrast, the more general case treated in Theorem 3.4 requires invoking more intricate geometrical considerations.

###### Theorem 3.3

In the Deffuant model on with the underlying opinion space and an initial opinion distribution we have the following limiting behavior:

1. If has radius and mass around its mean, i.e.

 P(η0∈B[Eη0,r])>0 for all % r>0, (6)

the critical parameter is , meaning that for we have a.s. no consensus and for a.s. strong consensus.

2. Let be the random initial opinion vector. If at least one of the coordinates has an unbounded marginal distribution, whose expected value exists (regardless of whether finite, or ), then the limiting behavior will a.s. be no consensus, irrespectively of .

###### Proof
1. To show the first part is just like in the univariate case (included in part (a) of Theorem 2.2) little more than following the arguments in the last two sections of [4]: The central arguments go through even for vector-valued opinions as the crucial properties of the absolute value that were used are shared by its replacement in higher dimensions, the Euclidean norm. Because of that, we only sketch the main line of reasoning and refer to Sect. 6 in [4] and Sect. 2 in [5] for a more thorough presentation of the arguments.

First of all, the (multivariate) Strong Law of Large Numbers – in the following abbreviated by SLLN – tells us that the averages in (5) for large are close to the mean in Euclidean distance. For fixed, choose such that the event

 A:={1n+1n+1∑u=1η0(u)∈B[Eη0,ε3] for all n≥N}

has positive probability. Using (6) and the fact that the initial opinions are i.i.d., we can locally modify the configuration to conclude that the event has positive probability, implying the -flatness to the right of site – just as it was done in La. 4.2 in [4].

For , the probability of is non-zero for small enough, hence a vertex can be at distance larger than from initially. Due to the independence of initial opinions, the event that site is -flat to the left, is -flat to the right and has positive probability. Using the SAD representation, it follows – mimicking Prop. 5.1 in [4] – that given such an initial configuration the opinion value at site will be a convex combination of averages in (5) for all times and thus in , due to the convexity of Euclidean balls. The same holds for site and the half-line to the left. Consequently, the edges and will stay blocked for ever. Ergodicity of the initial opinion sequence ensures that with probability (infinitely many) vertices will get isolated that way, which settles the subcritical case.

In the supercritical regime, i.e. , we focus on two-sidedly -flat vertices: If site is -flat to the left and is -flat to the right, both are two-sidedly -flat – using again the convexity of . By independence this event has positive probability, by ergodicity we will a.s. have (infinitely many) two-sidedly -flat vertices. Mimicking La. 6.3 in [4] literally, we find that vertices which are two-sidedly -flat in the initial configuration will never move further than away from the mean, irrespectively of future interactions. Choosing small, such that  say, will ensure that updates along edges incident to two-sidedly -flat vertices will never be prevented by the distance of opinions exceeding the confidence bound.

The proof of Prop. 6.1 in [4], which states that neighbors will either finally concur or the edge between them be blocked for large , can be adopted as well: Its central idea – borrowed from physics – that every individual starts with an initial amount of energy that is then partly transferred partly lost in interactions works regardless whether the opinions are shaped by numbers or vectors. Merely in the current setting, the term , that defines the energy at vertex at time , has to be read as a dot product. Again, if the opinions of two neighbors are within the confidence bound but for some fixed , decreases by at least when they compromise. This can not happen infinitely often with positive probability as the expected energy at time is and the expectation of is both non-increasing with and non-negative. For details see Prop. 6.1 and La. 6.2 in [4].

Following from the considerations above, two-sidedly -flat vertices and their neighbors therefore have to finally concur with probability , forcing the opinion values of the neighbors to eventually lie at a distance strictly less than from the mean as well. By our choice of , this conclusion propagates inductively showing that the limiting behavior will a.s. be strong consensus, if we let tend to .

2. In order to prove the second claim, we use part (b) of Theorem 2.2, focussing on the th coordinate only. Fix . Since

 |xi−yi|≤∥x−y∥2 for all vectors x,y∈Rk and i∈{1,…,k},

a distance of more than in the th coordinate of the opinion vectors for two neighbors implies that the edge between them is blocked. The arguments used for unbounded distributions in Theorem 2.2 (see Thm. 2.2 in [5]) show that under the given conditions, there are a.s. vertices that differ more than from both their neighbors in the th coordinate (with respect to the absolut value) in the initial configuration and this will not change no matter whom their neighbors will compromise with. Consequently, the corresponding opinion vectors will always be at Euclidean distance more than .

###### Remark

Pretty much as in the univariate setting, the case where all unbounded coordinates of do not have an expected value (neither finite nor nor ) remains unsolved by Theorem 3.3.

When it comes to bounded initial distributions which do have a large gap around the mean, the picture in higher dimensions drastically changes – something that

will require several preliminary results before we are ready to state and prove this section’s main result, Theorem 3.4. The major difference to the univariate case is that with higher-dimensional opinions the update along some edge can actually lead to a situation, where both and come closer to the opinion corresponding to a third vertex , which lies within the confidence bound of neither nor , see the picture on the right.

In the case of real-valued opinions this is impossible, because in that setting an update along always increases , if does not lie in between and .

To illustrate how this changes the conditions, let us consider the initial distributions , where denotes the Euclidean unit sphere in . For this is just , which by Theorem 2.2 has the trivial critical value . For however, the fact that opinions close to each other can compromise in order to form a central opinion will bring down to the radius 1 of the distribution as we will see in the sequel.

The statement of the main result in this section, Theorem 3.4, resembles very much the one of Theorem 2.2 (a), only the notion of a gap in the initial distribution has to be reinterpreted in the higher-dimensional setting, making the proof of this generalized result rather technical. However, while establishing auxiliary results, we will gain additional information about the set of opinion values that can occur in the Deffuant model at times depending on the initial distribution and the confidence bound. When it comes to the initial distribution , the most important features besides its expected value are its support and the corresponding radius.

###### Definition 3

Consider an -valued random variable . Its support is the following subset of , which is closed with respect to the Euclidean metric:

 supp(ζ):={x∈Rk,P(ζ∈B[x,r])>0 for all r>0}.

Observe that this definition corresponds to the standard notion of spectrum of a measure (see for example Thm. 2.1 and Def. 2.1 in [11]) – applied to the distribution of a random variable.

If the initial distribution has a finite expectation, the radius can also be written as

 R=sup{∥Eη0−x∥2,x∈supp(η0)},

as the following proposition shows.

###### Proposition 3.2

If , we have

 inf{r>0,P(η0∈B[Eη0,r])=1}=sup{∥Eη0−x∥2,x∈supp(η0)}. (7)

###### Proof

First, consider a set which is compact in and a subset of the complement of . The claim is that these properties of imply . Indeed, for every there exists s.t. . Let denote the open Euclidean ball with radius around , then is an open cover of , which by compactness has a finite subcover . Consequently

 P(η0∈A)≤P(η0∈n⋃i=1B[xi,rxi])=0.

If is greater than the supremum in (7) it follows that . Since

 (B(Eη0,r))c=(B[Eη0,r+1]∖B(Eη0,r))∪(⋃q∈Qk∖B[Eη0,r+1]B[q,1])

and the right-hand side is a countable union of nullsets with respect to , we get , which means that is greater or equal to the infimum in (7).

On the other hand, if is less than the supremum, there exists a point , which consequently has a positive distance to the closed ball . This gives

 P(η0∈B[Eη0,r])≤1−P(η0∈B[x,δ2])<1.

In other words, does not appear in the set the infimum is taken over. Putting both arguments together proves (7).

###### Definition 4
1. For a finite graph and an edge let the update described in (LABEL:dynamics), considered as a deterministic map on the set of -valued profiles, be denoted by . So if is applied to it just means that all values stay unchanged with the only exception of

 (Tθeξ(u)Tθeξ(v))=((1−μ)ξ(u)+μξ(v)μξ(u)+(1−μ)ξ(v))if ∥ξ(u)−ξ(v)∥2≤θ. (8)
2. Consider a finite section of the line graph, a finite sequence of edges and some values in . Such a triple will from now on be called a finite configuration.
To update the configuration (with respect to ) will mean that we take as initial opinions, i.e. we set for all , and then apply to .

Slightly abusing the notation, let the outcome, i.e. the final opinion values , be denoted by .

3. Let denote the initial distribution . For , let denote the set of vectors in which the opinion values of finite configurations can collectively approach, if updated according to confidence bound . More precisely, if and only if for all , there exist some , and as above, such that updating the configuration with respect to yields for all .

It is worth emphasizing that finite configurations are supposed to mimick the dynamics of the Deffuant model, interpreting as the locations of the first Poisson events on the edges in (strict) chronological order. In this respect, considering , we can choose the sequence such that only Poisson events causing an actual update are considered by simply eliminating all events on edges where the opinions of the two vertices are more than apart.

Note that according to the definition, depends on and , as well as , the latter being less obvious. See Example 3.4 below for an instance where actually makes a difference. Let us now turn to various properties of the set .

###### Lemma 3.1

Fix the distribution of and let and be defined as above.

1. is closed and increases with .

2. for all , where denotes the convex hull, the closure of a set .

###### Proof
1. The first claim follows directly from the definition: For a sequence in such that and every , there exists some . Due to , there exists a finite configuration with all final opinion values in . But since , this implies .

As for the second claim, since we are free to choose the edge sequence in finite configurations, it is obvious that making larger only allows for more options when we are to come up with a setting that brings the opinion values collectively inside for some given and .

2. The first inclusion is trivial, as for the finite configuration with will do. The second inclusion is due to the fact that every update of opinions is a convex combination, see (8). Consequently, all final opinion values of finite configurations lie within . The last inclusion, which is meaningful only for , follows from Proposition 3.2 and the fact that is both convex and closed.

It should be mentioned that an easy corollary to Carathéodory’s Theorem on the convex hull states that the convex hull of a compact set in is compact as well. If has a bounded support, this implies that the convex hull of is actually closed, i.e. .

###### Example 3.1

To get familiar with the idea behind , let us consider the discrete real-valued initial distribution given by . It is not hard to see that this implies . Having the Taylor expansion of the logarithm in mind we find

 Eη0=∞∑n=11n2n=−⎛⎝−∞∑n=1(12)nn⎞⎠=−ln(1−12)=ln(2).

By Theorem 2.2 we get , since and the largest gap in between the point masses is .

For two point masses situated at and at distance , all convex combinations of are in : For and , take s.t.

 ∣∣∣mm+n−α∣∣∣≤r4max{∥x∥2,∥y∥2}.

Let us set up a finite configuration with vertices, and as well as enough Poisson events on every edge (in an appropriate order) such that – having updated the configuration according to the edge sequence – the outcome will be at distance less than from the average for all . Since all the opinion values lie in an interval of length at most in the beginning and hence always will, we could choose the edge sequence by always taking the edge with largest current discrepancy next, to see that a finite sequence with the claimed property exists. This will ensure

 ∥ηN(v)−(αx+(1−α)y)∥2 ≤r2+∥(mm+nx+nm+ny)−(αx+(1−α)y)∥2 ≤r2+|mm+n−α|⋅∥x∥2+|α−mm+n|⋅∥y∥2 ≤r,

hence . This observation together with the fact that gaps of width larger than can not be bridged leads to

 Dθ(ν)=[0,1nθ]∪{1n,n

where .

###### Lemma 3.2
1. For all and , the set is convex.

2. If , then .

3. The connected components of are convex and at distance at least from one another. If is connected, then .

4. If and has mass around its mean, i.e. condition (6) holds, then already for .

5. For , the set-valued mapping

 {(0,∞)→Bkϑ↦Dϑ(ν)

is piecewise constant with only finitely many jumps on for all .

6. If is connected and finite, then

###### Proof
1. The proof of the first part of this lemma follows the idea of the above example. Let and their distance be . Let . For any , there exist finite configurations and with final values in and respectively. For choose again s.t.

 ∣∣∣mm+n−α∣∣∣≤r4max{∥y∥2,∥z∥2}.

We define a new finite configuration by putting copies of and copies of next to each other: Their finite sections of the line graph (together with the assigned initial values) will be concatenated blockwise – the order among the blocks being irrelevant – by adding an edge between two consecutive blocks in order to form the underlying line graph of a larger finite configuration. To get an edge sequence for the whole configuration we will simply string together the edge sequences of the individual copies, again in a blockwise manner and arbitrary order.

Updating according to the edge sequence will then bring all the opinion values within distance of one another. Therefore, we can bring the final outcomes arbitrarily close, say at distance at most , to the average of the initial values, let’s denote it by , by just adding a large enough (but finite) number of Poisson events on each edge (appropriately ordered as before). From the properties of the chosen building blocks, and , it readily follows that the initial average is at distance at most from . This entails for every vertex of the finite configuration

 ∥ηN(v)−(αy+(1−α)z)∥2 ≤r4+∥¯¯¯x−(αy+(1−α)z)∥2 ≤r4+r4+∥(mm+ny+nm+nz)−(αy+(1−α)z)∥2 ≤r2+|mm+n−α|⋅∥y∥2+|α−mm+n|⋅∥z∥2 ≤r,

which shows .

2. By Lemma 3.1 it is enough to show . Thus, letting , we have to show that . But since can be at most , this is done as described in Example 3.1, just the line segment plays now the role of the interval considered there.

3. First of all, the connected components of are actually path-connected and moreover the pathes can be chosen to be polygonal chains: Assume that a connected component contains more than one path-connected component. Fix one such, say . Due to connectedness of , a second one must exist s.t. the Euclidean distance between and is . But part (a) then implies that also is path-connected, a contradiction. Moreover, using the statement of part (a) we can transform any curve in to a polygonal chain which completely lies in .

Let us turn to the convexity of connected components. Fix a component of and , s.t. , since otherwise (a) guarantees

 conv({x,y})={αx+(1−α)y,α∈[0,1]}⊆C.

By the above, there exists a polygonal chain in , say

 l:={[0,1]→Rks↦l(s)

such that and is continuous and piecewise linear. Let us define where , if and otherwise. Using (a) and these intermediate points shows that we can assume without loss of generality a certain sparseness of the chain, namely that its intermediate points are s.t. pairwise distances in are at least and hence , where denotes the length of the original chain. Note that the modification of the polygonal chain as just described will only decrease its length.

Given a polygonal chain in connecting and , let us assume that the minimal angle at an intermediate point is at . Considering and using (a) once more, we can replace by the two intersection points of the ball’s boundary and the chain and conclude that the polygonal chain through the points still lies in and is at least by shorter.

We can then sparsify the updated chain as described above and denote the result by . Iterating the whole procedure gives a sequence of shorter and shorter polygonal chains in connecting and . Since the length is bounded below by , the internal angels must approach uniformly. Let be the angles at . An easy geometric argument yields that all points on the chain are at distance at most

 n∑j=1tan(2α1+⋯+2αj)L≤8nLπn∑j=1αj≤16L2πθn∑j=1αj.

from the line through and , if , as for all . This also holds for the endpoint , which is why the maximal distance of a point on the chain to the line segment between and is bounded by . Let and correspond to . Then

 nm∑j=1α(m)j≤2Lθmax1≤j≤nmα(m)j\lx@stackrelm→∞⟶0

implies that the sequence must approach the line segment between and , i.e. , uniformly – in the sense that

 maxs∈lmminz∈conv({x,y})∥s−z∥2→0as m→∞.

Since being a component of is closed, we find which proves the convexity of C.

Assuming that there are two points in different connected components, say s.t. , already implies (by part (a)) that is connected, as before. Finally, if is connected, what we just proved induces that it is convex. Being a closed superset of , this implies

 Extra open brace or missing close brace

which by Lemma 3.1 is all that needed to be shown.

4. Let us now assume that has not only a finite radius but also mass around its mean, that is . For , is then connected, which by part (c) implies the claim. Indeed, let and choose a point in . By the choice of , all points in are at distance less than from , which by the reasoning in part (a) and (see Lemma 3.1) implies for all , hence the connectedness of .

5. The first thing to notice is that, given , for all the set has finitely many connected components. Indeed, choose a point in each, then the open balls must be disjoint by (c) and lie within . Consequently, there can’t be more than of them.

Let be the connected components of , for some , and the minimal distance between them. When is made larger than , at least two of the components merge. Hence there can be only further jumps. For


text:
# strictly positive elements in $C^*$-algebra

Let $A$ be a $C^*\text{-algebra}$ and $A_+$ denote the positive elements. An element $a\in A_+$ is called

strictly positive if $\overline{aAa}=A$. Want to find the following:

a)What are the strictly positive elements of $C_0(\Omega)$ where $\Omega$ is locally compact Hausdorff space, and $C_0(\Omega)$ is the space of continuous complex valued functions that vanishes at $\infty$.

b)If $A$ is unital, then $a\in A_+$ is strictly positive iff $a$ is invertible.

c)if $(e_n)$ is an approximate identity of $A$, then $a:=\sum_{n=}^{\infty}\frac{1}{2^n}e_n$is strictly positive.

What I tried and know:

a) I know that positive elements in this space are functions with positive images, and thus, strictly positive elements are functions with positive images and now real root. is this correct? and how can I show that the positive elements are these kind of functions.

b) I figures out that if $a$ in invertible then $a$ is strictly positive, but no idea how to do the other direction.

c)I did this but using another characterization of strictly positive elements but want to do it with this one, and I don't know how.

• @julien, Yes, Now I need to show what are the positive functions you described satisfies $\overline{aAa}=A$., my intuition says it should be functions with range in $(0,\infty)$ but I can't really work the details. – i.a.m Mar 24 '13 at 20:52
• @julien, Yes there are no non zero constant functions here, can you tell me how to fix this? – i.a.m Mar 24 '13 at 21:35
• @julien : But that only shows that the set of strictly positive elements in $C_0(\Omega)$ lies in the set $\{ f \in C_0(\Omega) | Image (f) \subset (0, \infty)\}$. How to derive the exact set of strictly positive elements ? – user44349 Mar 25 '13 at 4:33
• I just wrote an answer for part (b) in this question – user56706 Mar 25 '13 at 15:07
• @VahidShirbisheh, Thank you for the answer, any idea how to do part c? – i.a.m Mar 25 '13 at 15:13

Question a) Denoting $\widetilde{\Omega}$ the one point compactification of $\Omega$, and denoting $\infty$ the extra point, we have a natural isometric embedding of $C_0(\Omega)$ into $C(\widetilde{\Omega})$. The range of this embedding is $$A=\{f\in C(\widetilde{\Omega})\;;\;f(\infty)=0\}.$$ This is clearly a sub $C^*$ algebra of $C(\widetilde{\Omega})$. We claim that its strictly positive elements are $$A_{++}=\{f\in A\;;\; f(x)\neq 0\;\forall x\in \Omega\}.$$

The key tool is Urysohn's lemma for $C(\widetilde{\Omega})$, which holds because $\widetilde{\Omega}$ is Hausdorff compact, hence normal.

First, assume that $f\in A$ vanishes at some $x_0$ in $\Omega$. By Urysohn, there exists $g\in C(\widetilde{\Omega})$ such that $g(x_0)=1$ and $g(\infty)=0$. Now every function $h$ in $fAf$ has $f(x_0)=0$, hence also every function in $\overline{fAf}$. So $g$ can't belong to the latter, and $f$ is not strictly positive.

Assume now that $f\in A$ does not vanish on $\Omega$. For every function $g\in A$ with support contained in $\Omega$, we can write $g=fhf$ with $h=g/f^2$ on the support of $g$ and $0$ elsewhere. So $g$ belongs to $fAf$. Now every function in $A$ is the uniform limit of functions with support in $\Omega$, using Urysohn again. So $\overline{fAf}=A$, i.e. $f$ is strictly positive.

Back to $C_0(\Omega)$, the strictly positive elements are the positive elements which do not vanish on $\Omega$. That is the positive functions with limit $0$ at $\infty$.

Question b) If $a$ is invertible, then every $x\in A$ can be written $x=aya$ with $y=a^{-1}xa^{-1}$ in $A$. So $A=aAa$. Conversely (the argument has laready been given here by Vahid Shirbisheh), if $A=\overline{aAa}$, then a fortiori $1$ belongs to $\overline{aAa}$. So there exists $x\in A$ such that $\|1-axa\|<1$. As is well-known, in a Banach algebra, this implies that $axa$ is invertible (cf. Neumann series). It follows that $a$ is both left and right invertible, hence invertible. This proves the equivalence.

Question c) I assume by approximate identity you mean every $e_n$ is positive, has $\|e_n\|\leq 1$, and $\lim xe_n=\lim e_nx=x$ for every $x\in A$. The series defining $a$ is absolutely convergent, so $a$ is well-defined.

The only proof I can think of uses the following characterization: $a\geq 0$ such that $\|a\|\leq 1$ is strictly positive if and only if $a^\frac{1}{n}$ is an approximate identity of $A$.

It only remains to observe that $\|a\|\leq 1$ and that, indeed $a^\frac{1}{n}$ is an approximate identity. This follows from the inequalities $$h^\frac{1}{m}\geq \frac{1}{2^\frac{n}{m}}h_n^\frac{1}{m}\geq \frac{1}{2^\frac{n}{m}}h_n$$ for all $n,m$.

• Thank you for this answer, and yes please do more, when you have the time its much appreciated. Thank you – i.a.m Mar 25 '13 at 13:28
• Hi @julien I have a question. But I cannot produce any idea. There exist an answer.but not enough in order for me to understand..i think. Please can you teach me the solution more precisely. Thank you. – user315 Mar 25 '13 at 17:28

format: plain


text:
# Tag Info

## Hot answers tagged wheatstone-bridge

14

The strain gauge elements come with a positively stress-sensitive portion and a negatively stress-sensitive portion. If you wire them up carefully by flipping them around so the stress sensitive portions unbalance the bridge constructively, you can use all four sensors without any extra resistors. jonk's link to the blog post at http://www.nerdkits.com/...

9

What you are missing is that the common purpose of using a Wheatstone bridge is to balance two sensors. Ie. when we use a Wheatstone bridge we usually have two variable resistances or current sources that we want to balance like this; simulate this circuit – Schematic created using CircuitLab You are right in concluding that if we only have one ...

7

OK, problem solved. The bridge is connected like this. Only one resistance in the load cells is variable, the other is fixed. Why the confusion above? I was measuring resistance of a load cell which came from a different scale. The cells looked pretty similar, therefore I thought they were the same. But they were not! Eureka! simulate this circuit – ...

7

I'm going to state this up front - a differential amplifier made from an op-amp and four resistors is perfectly fine when (and only when) the input sources are much, much lower impedance than the resistors used. You will not get this when a bridge is attached because, as the bridge is off-balanced by whatever it is you are measuring, its output resistance ...

7

I'm betting a component is quantization noise or other distortion on the AFG3000, which has 14bit output. The harmonic distortion is listed as -60dB in your freq range. You might try using a cleaner sine wave and seeing what you get, or condition the blazes out of the excitation wave you have. In any case, after asking about long cables that may be ...

6

Start with the Wheatstone bridge equation from wikipedia which is the subtraction of two voltage dividers. $$V_G = V_s( \frac{R_x}{R_3+R_x} - \frac{R_2}{R_1+R_2})$$ Sensitivity is the derivative with respect to $R_x$. You'll notice immediately that the voltage divider that doesn't have the element of interest doesn't impact the sensitivity at all. The ...

5

Having a capacitor directly across the op amp inputs always looks iffy to me. It can make the op amp trend to oscillate because high frequency feedback gets attenuated. If you are measuring the 1.5v "latch-up" voltage with a DC volt meter, you might simply be seeing the average voltage of an oscillation. Try placing C1 before R2 and R3 and see if that ...

5

With a 24 volt supply, the current thru the limb of the bridge containing the thermistor is: - Nearly 11mA at 0C Nearly 19mA at 50C At 0C this produces a power in the thermistor of 132mW and 63mW at 50C. To me this is a problem. The self-heating of the thermistor will create a significant measurment error at 0C compared to 50C. I'd use an instrumentation ...

5

The load cell parts you have are most likely arranged as shown in the first diagram below. (This is a typical half bridge.) You should use an ohm meter to confirm the wire colors. In some low cost load cells one resistor (strain gage) will be active (changes with stress), and the other a reference (which can also help temperature compensate the other). ...

4

Consider getting rid of the bridge and instrumentation amplifier. Feed the RTD (via 10k) from the same reference voltage that your ADC uses - this is called ratiometric measurements and removes one of the big error sources i.e. because RTD and ADC are both ultimately fed from a common reference voltage, it doesn't matter if that reference voltage drifts. So,...

4

[Disclaimer: I haven't seen such arrangement before. Below is an educated guess.] This looks like a self-test feature, rather than extra excitation. When Q2 is conducting, R11 appears in parallel with R3. That introduces a small imbalance in the bridge. If the measurement circuitry detects this imbalance, then self-test passed successfully.

4

You need to respect the amplifier input common mode range (and output range). If your amplifier (I'll assume it's an AD8221 inamp) had large power supply voltages your bridge configuration would be fine. You're putting about 0.7mA through the RTD element, which is reasonable for a Pt100. Your full-scale span will be 100mV, so you need sufficient gain in the ...

4

Having recommended reading about partition noise I'm finding nothing terribly useful online myself! So I'll try running a few numbers. In the absence of a better reference model, I'll model it simply as 2 shot noise sources, one in each leg of the bridge. (The sum will be simply the shot noise inherent in the same total current from the sig gen). Applying ...

4

I was wondering what the purpose of the Vref is What you have is called a differential amplifier and, the ratio of R3 and R4 should be the same as the ratio of R1 and R2: - When you use a "ref" voltage instead of 0V the output from the differential amplifier is "referenced" to the ref voltage. A typical example might be to make ref = 2.5 volts and, when ...

4

Wheatstone Bridge style strain gauges have 4 wires, as shown in the circuit diagram you posted. Red and Black are for your excitation voltage, white and green is your differential output voltage that's scaled by that excitation voltage you provide.

4

The problem with using a voltage reference version is that the circuit depends on the difference between two accurate voltage sources, V and Vref. In the Wheatstone bridge, there is just one voltage source, and there is some error cancelation. Accurate voltage references are noisy and difficult to filter without losing accuracy. They have good long-term ...

3

I found that the "A"-resistors are not fixed but show a mirrored resistance change because they undergo a compression instead of an elongation. This is because there is not a simple arc-bending of the metal arm, but, the special rivet fixation of the upper arm part, results in a complex "S"-forming bending .So both sensors can be glued on the same side of ...

3

If all the half-bridge sensors changed their resistance exactly the same when a load was applied, can you see that they could be mounted in parallel - the effective end-to-end resistance would drop from 2 kohm to 1 kohm but that is of no consequence to a bridge measurement circuit. Even if there are disparities in the resistance between two paralleled ...

3

In order for the bridge to produce an output between S- and S+ the bridge must become "unbalanced" when weight is applied. So if all 4 load cells produce equally increasing or decreasing resistances when weight is applied the bridge will remain balanced and the output will not change. If the load cells are arranged such that the left and right halves of ...

3

It isn't a good idea to use resistive temperature sensors this way because of the large change in resistance will delinearize the bridge whether current fed or voltage fed. Devices like strain gauges bearly change their resistance at all and can be ok as a single active element in a bridge but not RTDs. So, use the three wire connection and use a constant ...

3

Load cells are ratiometric, so the output voltage will be proportional to the excitation voltage. Operating at a low excitation voltage will reduce the fullscale output from the gage, as you have identified. This isn't really a problem other than the fact that the differential output voltage of a load cell is so low to start with. Assuming that you're ...

3

Here is a 5 second answer to start. First, put a decoupling cap (0.1uF or something like that) between LM324 pins 4 and 11 (its just good practice). Just for testing connect LM324-1 to LM324-2 (unity gain), because an OpAmp is meant to be used with feedback. Of course you know that you will need a differential amp sensing both sides of the bridge to get ...

3

INA126 is an InAmp of the two-OpAmp variety. The REF pin, which can be used to provide an ofset for the output. $V_O = G (V_{(+)}-V_{(-)}) + V_{REF}$ This is similar the output offset trimming circuit in fig.2 in the INA126 datasheet.

3

As a general guideline, it is preferable to connect any cable shields to the metal chassis (not PCB ground), at just one end. To keep things simple when multiple shielded cables connect out from some central device, the shield connection should be done only at the "hub" device, and left open at the "spoke" devices. Similarly, for a chain of devices ...

3

There are two key benefits of null-balance measuring methods. The first is that the quantity being measured is not affected in any way by the measurement when the system is in balance; i.e., there are no "loading" effects. The second is that since the measurement is always made at the same point on the indicating device, any nonlinearities in the ...

3

You have 3V applied to the inverting input and 2.5V applied to the non-inverting input. Thus, your output should be -1V with a gain of 2 (assuming reference grounded). It should work properly if the amplifier has a reasonable negative supply (say -5V). However, you show no negative supply, so the amplifier cannot work- the best it can do is get within some ...

3

The likely reason that the classic Wheatstone bridge is showing that a galvanometer is used to measure the bridge imbalance is that "back in the day" this was the most sensitive way to measure a very small bridge change. A galvanometer could be built that sensed very small current changes. These days "in modern times" with circuit advances being made in ...

3

Your first approach is unlikely to work very well because analog multiplexers don't exhibit good resistance matching between channels - in the case of HEF4067B, it's listed as up to 25 ohms mismatch. They also exhibit variable on resistance over voltage: Your second approach should work because current won't be flowing through the MUX, meaning the ...

3

First of all you should really get better resistors. 5% with a strain gauge is just ridiculous. To "trim and calibrate" your measurement you should just leave your gauges be, i.e. leaving them in a known state, measure the output and save it in a variable in your micro. This value should then be subtracted from all subsequent measurements. If you can you ...

3

This is a better view of a fairly generic load cell comprising 4 strain gauges: - A simple single-ended power supply can be used (such as 5V) and this is applied between red and black wires with black being connected to 0V. The green and white wires will nominally be centred at about 2.5 volts with no load. One wire's voltage will rise with load whilst the ...

Only top voted, non community-wiki answers of a minimum length are eligible


text:
1.4k views

Consider the following declaration of a two-dimensional array in C:

char $a[100][100]$;

Assuming that the main memory is byte-addressable and that the array is stored starting from memory address $0$, the address of $a [40][50]$ is

1. $4040$
2. $4050$
3. $5040$
4. $5050$
edited | 1.4k views

In C, arrays are always stored in row-major form.

Formula to evaluate 2-D array's location is:----

$loc(a[i][j]) = BA + [(i-lb_1)\times NC+(j-lb_2)]\times c$

where,

$BA$ - Base Address
$NC$ - no. of columns
$c$ - memory size allocated to data type of array

$a[lb_1 \cdots ub_1] [lb_2\cdots ub_2]$

here $BA=0, NC =100, c=1, a[0.....99][0......99]$ so $lb_1=0 , lb_2=0$

$loc(a[40][50])= 0+ [ (40-0)\times 100 + (50-0)]\times 1$
$= 0+[4000+50]\times 1 = 4050$

edited by
+2
Why column major used here,and not row major?
0
very well explained
0
i think by these ans may be contradict but by default we use  column majaor

.its a naive approach :)
0
why coloum major order plese explain because if we solve this from row major order then anwer will come out to be 5040 (Option C) which is also given in the option ?
0
Why element size is 1?
0
char --> 1
+3
Who is using column major? It is row-major which is mandated in C.
0

@Arjun sir....any source plss

+2
B is the answer, and RMO is used here not CMO.
0
Because here both answers are given, 1)CMO - 5040 , 2) RMO - 4050 then how to decide the correct one?
0

Shubhgupta Use row major .Use column major when it is exclusively mentioned in question.

OPTION B


text:
# Boundary conditions

1. Jun 23, 2008

### harpreet singh

Hey people can u please tell me what will be the boundary conditions for a circular plate with a central hole clamped at the circumference... Plate is axis symmetric and is under uniform load..

2. Jun 23, 2008

### FredGarvin

You'll obviously have no displacements at the outer edge. There should also be a zero slope at the edge. At the center there are similarities for the conditions of a beam's free end. Can you think of what those would be?

3. Jun 23, 2008

### harpreet singh

These two were known to me.. I was encountring problem with the inner edge only..

4. Jun 23, 2008

### FredGarvin

Well, if you have a cantilevered beam, what can you say about the moment at the free end?

5. Jun 23, 2008

### harpreet singh

I guess moment will b zero there

6. Jun 23, 2008

### harpreet singh

But then also i will be needing 1 more condition coz i have 4 constants to be determined in my equation..

7. Jun 23, 2008

### Mech_Engineer

Is the shear force defined at the fixed edge of the plate, perhaps by calculating the resultant reaction at that edge?

8. Jun 23, 2008

### harpreet singh

Will there be any shear force at the fixed edge??

9. Jun 23, 2008

### Mech_Engineer

On a uniformly loaded a cantilever beam, the shear force will be maximum at the fixed end of the beam, and equal to the reaction force at that end. Additionally, since the beam is only supported by one end, the shear force is zero at the free end of the beam.

10. Jun 23, 2008

### Mech_Engineer

According to Roark's Table 11.2 Case 2e (Annular plate, outer edge fixed, inned edge free), the following boundary conditions apply:

• Bending moment at the free end is zero.
• Shear force at the free end is zero.
• Displacement at the fixed end is zero.
• Slope at the fixed end is zero.

They also have a definition of the shear force at the fixed edge (enge "a") that is basically a calculation of the reaction force along that edge.

$$Q_{a}=\frac{-q}{2a}(a^2-r_{o}^2)$$

11. Jun 23, 2008

### harpreet singh

Thanx a lot.. can u plz send me that link??

12. Jun 23, 2008

### Mech_Engineer

Last edited by a moderator: Apr 23, 2017
13. Jun 23, 2008

### harpreet singh

Ok.. Do u have ebook or hard copy??

14. Jun 23, 2008

### harpreet singh

Can u please check wat r d conditions if inner edge is simply supported and outer edge clamped..

15. Jun 23, 2008

### FredGarvin

I was trying to not directly quote that to get the OP to think about the conditions on his own...Make him work!

16. Jun 23, 2008

### harpreet singh

Thanx a lot sir for helping me that way..

17. Jun 23, 2008

### Mech_Engineer

Sorry about that Fred, I just get so excited!

Its quite easy to interpolate what you've "learned" on the case above to the simply supported case. Perhaps trying to sketch a rough shear force and bending moment diagram could help you... specifically looking at what a simple support's effect looks like on those diagrams.

18. Jun 23, 2008

### harpreet singh

sorry but i got stuck once more.. I am not being able to integrate dw/rdr w.r.t dr

19. Jun 23, 2008

### FredGarvin

I just can't touch that one...


text:
# What is the interval for the particular solution?

1. Feb 2, 2016

1. The problem statement, all variables and given/known data
dy/dx = (9x²)/(9y²-11) , y(1)=0

2. Relevant equations

3. The attempt at a solution
I've found the particular solution:

3y³-11y = 3x³-3

The solution is defined for -⅓√11<y<⅓√11,
What about the x values? Plugging the y values into the equation doesn't work of course..

2. Feb 2, 2016

### RUber

It looks to me that your solution is defined everywhere...how did you conclude the interval above?

3. Feb 2, 2016

### RUber

I see now...since you start with y=1, there is no way to continuously make it outside that interval -- where $9y^2 - 11 = 0$.
To solve for the domain of x, I would recommend finding the range (max, min) of the function of y over the interval of definition. This would give you a domain defined by:
$3x^3 - 3 \in \left[ \min_{y \in ( -\sqrt{11}/3, \sqrt{11}/3)} \{3y^3 -11\} , \max_{y \in ( -\sqrt{11}/3, \sqrt{11}/3)} \{3y^3 -11\}\right].$

4. Feb 2, 2016

Yes I understand all of this, however my assignment wants me to show the interval of existence like this:

A < x < B

That is, to find the domain, not the range. How can I do that?

5. Feb 2, 2016

I don't think actual values are possible here? Only approximations of "x" for values greater by closest to -⅓√11 and smaller but closest to ⅓√11...

6. Feb 2, 2016

### RUber

The function of y, $f(y) = 3y^3-11y$ has its own domain and range. The domain is $-\sqrt{11}/3 < y < \sqrt{11}/3.$ What is its range?
If $g(x)=3x^3 - 3$, then the range of f(y) must equal the range of g(x). Then you find the domain of x that restricts g to the range you have found.
For example if the minimum of f(y) is -10, you would say:
$g(x) > -10 \\ 3x^3 - 3 > -10 \\ x^3 > -7/3 \\ x > (-7/3)^{1/3}$


text:
# Credits to AutoMATHic

Algebra Level 3

Find the value of $$x$$ such that $$\displaystyle \sum_{n=1}^x ( n i^n) = 2000 + 2001 i$$.

Notation: $$i = \sqrt{-1}$$ is the imaginary unit.

×


text:
Meet students taking the same courses as you are!Join a Numerade study group on Discord

# Use the region $R$ with the indicated boundaries to evaluate each double integral.$$\iint_{R} \frac{1}{x} d y d x ; \quad 1 \leq x \leq 2,0 \leq y \leq x-1$$

## $\approx 0.3069$

### Discussion

You must be signed in to discuss.
##### Heather Z.

Oregon State University

##### Kristen K.

University of Michigan - Ann Arbor

##### Samuel H.

University of Nottingham

##### Michael J.

Idaho State University

Lectures

Join Bootcamp

### Video Transcript

{'transcript': "Okay, so here we have the double integral wond too. And then zero two X minus one of one over X. Why? T x clerk. So let's take an anti derivative with respect to why so this one over X it's actually just a constant so really Teo Teo, one of ex What are beginning here. But we're just integrating. Why s so we'LL just get why evaluated X minus one So that's just X minus one the ex. Okay, and then we'LL distributes. So you have. Ah, one minus one of her ex the ex. So what is that x minus log? Perhaps a value of X but X is between one and two, so we don't need the absolute value Evaluated from one to two. Says there's going to be two units one minus. Wow. Goes to slog one. That's gonna be one minus log to remember the log of one zero"}

Georgia Southern University
##### Heather Z.

Oregon State University

##### Kristen K.

University of Michigan - Ann Arbor

##### Samuel H.

University of Nottingham

##### Michael J.

Idaho State University

Lectures

Join Bootcamp


text:
# Partial differentiation of the general function homogeneous of degree n [on hold]

If $$f$$ is homogeneous of degree $$n$$, $$f(tx,ty) = t^{n}f(x,y)$$
show that $$f_{x}(tx,ty) = t^{n-1}f_{x}(x,y)$$

My proof went a little wrong as follow:
$$u=tx, v=ty \quad f_{x}(tx,ty) = \frac{\partial f(u,v)}{\partial u} \cdot \frac{\partial u}{\partial x}+\frac{\partial f(u,v)}{\partial v}\cdot \frac{\partial v}{\partial x} = f_{u}(u,v) \cdot t$$…….(1)
$$\quad\quad\quad\quad\quad\quad\frac{\partial}{\partial x}(t^nf(x,y))=t^nf_{x}(x,y)$$…….(2)
(1)=(2)$$\qquad f_{u}(u,v)=t^{n-1}f_{x}(x,y)$$
$$\quad \quad \quad\quad \,f_{u}(tx,ty) = t^{n-1}f_{x}(x,y)$$

On the last line, the footnote on the left side is supposed to be $$x$$, however, I get $$u$$.


text:
# Basic Arithmetic : Factoring

## Example Questions

### Example Question #13 : Operations In Expressions

Factor the following expression completely:

Explanation:

To factor an expression in the form , we need to find factors of  that add up to .

In this case,  and .

Start by listing factors of 24 and adding them up. You want the one that adds up to 10.

Because 4 and 6 are the factors that we need, you can then write

To check if you factored correctly, you can multiply the two factors together. If you end up with the original expression, then you are correct.

### Example Question #1 : Factoring

Factor the following expression completely

Explanation:

First, we need to factor the numerator and the denominator separately.

To factor an expression with the form , we will need to find factors of  that add up to be.

For the numerator,  and .

Write down the factors of  and add them up.

Since  and  add up to

Now, do the same thing with the denominator, .

Since  and  add up to .

Now, stack these factors up as fractions:

Since both the numerator and denominator have the factors (x+6), they cancel each other out because they divide to 1.

Then,

### Example Question #14 : Operations In Expressions

Factor the following expression:

Explanation:

When you factor an expression, you are separating it into its basic parts. When you multiply those parts back together, you should obtain the original expression.

The first step when factoring an expression is to see if all of the terms have something in common. In this case, , and  all have an  which can be taken out:

The next step is to focus on what's in the parentheses. To factor an expression of form , we want to try to find factors , where  and . We therefore need to look at the factors of  to see if we can find two that add to :

We've found our factors! We can therefore factor what's inside the parentheses, , as . If we remember the  we factored out to begin with, our final completely factored answer is:

### Example Question #1 : Factoring

Explanation:

This question requires you to understand order of operations, which is represented by the acronym "PEMDAS": parentheses, exponents, multiplication and division, addition and subtraction.

Solve the expression within the parenthesis first, beginning with multiplication:

The next operation in the order of operations is division.

Finally, use addition to solve the equation:

Factor


text:
# How do you evaluate the function f(x)=9x^3-x^2+2 for f(2)?

Aug 6, 2017

$70$

#### Explanation:

$f \left(x\right) = 9 {x}^{3} - {x}^{2} + 2$

$f \left(2\right)$ means that we are told that $x = 2$ , and asked to find the value for $f \left(x\right)$, which is also $y$

$f \left(x\right) = 9 {x}^{3} - {x}^{2} + 2$

$f \left(2\right) = 9 {\left(2\right)}^{3} - {\left(2\right)}^{2} + 2$

$f \left(2\right) = 9 \left(8\right) - 4 + 2 = 70$

This gives us the ordered pair $\left(2 , 70\right)$


text:
# Mathieu function

In mathematics, the Mathieu functions are certain special functions useful for treating a variety of problems in applied mathematics, including:

They were introduced by Émile Léonard Mathieu (1868) in the context of the first problem.

## Mathieu equation

The canonical form for Mathieu's differential equation is

$\frac{d^2y}{dx^2}+[a-2q\cos (2x) ]y=0.$

The Mathieu equation is a Hill equation with only 1 harmonic mode.

Closely related is Mathieu's modified differential equation

$\frac{d^2y}{du^2}-[a-2q\cosh (2u) ]y=0$

which follows on substitution $u=ix$.

The two above equations can be obtained from the Helmholtz equation in two dimensions, by expressing it in elliptical coordinates and then separating the two variables.[1] This is why they are also known as angular and radial Mathieu equation, respectively.

The substitution $t=\cos(x)$ transforms Mathieu's equation to the algebraic form

$(1-t^2)\frac{d^2y}{dt^2} - t\, \frac{d y}{dt} + (a + 2q (1- 2t^2)) \, y=0.$

This has two regular singularities at $t = -1,1$ and one irregular singularity at infinity, which implies that in general (unlike many other special functions), the solutions of Mathieu's equation cannot be expressed in terms of hypergeometric functions.

Mathieu's differential equations arise as models in many contexts, including the stability of railroad rails as trains drive over them, seasonally forced population dynamics, the four-dimensional wave equation, and the Floquet theory of the stability of limit cycles.

## Floquet solution

According to Floquet's theorem (or Bloch's theorem), for fixed values of a,q, Mathieu's equation admits a complex valued solution of form

$F(a,q,x) = \exp(i \mu \,x) \, P(a,q,x)$

where $\mu$ is a complex number, the Mathieu exponent, and P is a complex valued function which is periodic in $x$ with period $\pi$. However, P is in general not sinusoidal. In the example plotted below, $a=1, \, q=\frac{1}{5}, \, \mu \approx 1 + 0.0995 i$ (real part, red; imaginary part; green):

## Mathieu sine and cosine

For fixed a,q, the Mathieu cosine $C(a,q,x)$ is a function of $x$ defined as the unique solution of the Mathieu equation which

1. takes the value $C(a,q,0)=1$,
2. is an even function, hence $C^\prime(a,q,0)=0$.

Similarly, the Mathieu sine $S(a,q,x)$ is the unique solution which

1. takes the value $S^\prime(a,q,0)=1$,
2. is an odd function, hence $S(a,q,0)=0$.

These are real-valued functions which are closely related to the Floquet solution:

$C(a,q,x) = \frac{F(a,q,x) + F(a,q,-x)}{2 F(a,q,0)}$
$S(a,q,x) = \frac{F(a,q,x) - F(a,q,-x)}{2 F^\prime(a,q,0)}.$

The general solution to the Mathieu equation (for fixed a,q) is a linear combination of the Mathieu cosine and Mathieu sine functions.

A noteworthy special case is

$C(a,0,x) = \cos(\sqrt{a} x), \; S(a,0,x) = \frac{\sin(\sqrt{a} x)}{\sqrt{a}},$

i.e. when the corresponding Helmholtz equation problem has circular symmetry.

In general, the Mathieu sine and cosine are aperiodic. Nonetheless, for small values of q, we have approximately

$C(a,q,x) \approx \cos(\sqrt{a} x), \; \; S(a,q,x) \approx \frac{\sin (\sqrt{a} x)}{\sqrt{a}}.$

For example:

Red: C(0.3,0.1,x).
Red: C'(0.3,0.1,x).

## Periodic solutions

Given $q$, for countably many special values of $a$, called characteristic values, the Mathieu equation admits solutions which are periodic with period $2\pi$. The characteristic values of the Mathieu cosine, sine functions respectively are written $a_n(q), \, b_n(q)$, where n is a natural number. The periodic special cases of the Mathieu cosine and sine functions are often written $CE(n,q,x), \, SE(n,q,x)$ respectively, although they are traditionally given a different normalization (namely, that their L2 norm equal $\pi$). Therefore, for positive q, we have

$C \left( a_n(q),q,x \right) = \frac{CE(n,q,x)}{CE(n,q,0)}$
$S \left( b_n(q),q,x \right) = \frac{SE(n,q,x)}{SE^\prime(n,q,0)}.$

Here are the first few periodic Mathieu cosine functions for q = 1:

Note that, for example, $CE(1,1,x)$ (green) resembles a cosine function, but with flatter hills and shallower valleys.


text:
# A Practical Introduction to Deep Learning with Caffe and Python

Deep learning is the new big trend in machine learning. It had many recent successes in computer vision, automatic speech recognition and natural language processing.

The goal of this blog post is to give you a hands-on introduction to deep learning. To do this, we will build a Cat/Dog image classifier using a deep learning algorithm called convolutional neural network (CNN) and a Kaggle dataset.

This post is divided into 2 main parts. The first part covers some core concepts behind deep learning, while the second part is structured in a hands-on tutorial format.

In the first part of the hands-on tutorial (section 4), we will build a Cat/Dog image classifier using a convolutional neural network from scratch. In the second part of the tutorial (section 5), we will cover an advanced technique for training convolutional neural networks called transfer learning. We will use some Python code and a popular open source deep learning framework called Caffe to build the classifier. Our classifier will be able to achieve a classification accuracy of 97%.

By the end of this post, you will understand how convolutional neural networks work, and you will get familiar with the steps and the code for building these networks.

The source code for this tutorial can be found in this github repository.

# 1. Problem Definition

In this tutorial, we will be using a dataset from Kaggle. The dataset is comprised of 25,000 images of dogs and cats.

Our goal is to build a machine learning algorithm capable of detecting the correct animal (cat or dog) in new unseen images.

In Machine learning, this type of problems is called classification.

# 2. Classification using Traditional Machine Learning vs. Deep Learning

Classification using a machine learning algorithm has 2 phases:

• Training phase: In this phase, we train a machine learning algorithm using a dataset comprised of the images and their corresponding labels.
• Prediction phase: In this phase, we utilize the trained model to predict labels of unseen images.

The training phase for an image classification problem has 2 main steps:

1. Feature Extraction: In this phase, we utilize domain knowledge to extract new features that will be used by the machine learning algorithm. HoG and SIFT are examples of features used in image classification.
2. Model Training: In this phase, we utilize a clean dataset composed of the images' features and the corresponding labels to train the machine learning model.

In the predicition phase, we apply the same feature extraction process to the new images and we pass the features to the trained machine learning algorithm to predict the label.

The main difference between traditional machine learning and deep learning algorithms is in the feature engineering. In traditional machine learning algorithms, we need to hand-craft the features. By contrast, in deep learning algorithms feature engineering is done automatically by the algorithm. Feature engineering is difficult, time-consuming and requires domain expertise. The promise of deep learning is more accurate machine learning algorithms compared to traditional machine learning with less or no feature engineering.

# 3. A Crash Course in Deep Learning

Deep learning refers to a class of artificial neural networks (ANNs) composed of many processing layers. ANNs existed for many decades, but attempts at training deep architectures of ANNs failed until Geoffrey Hinton's breakthrough work of the mid-2000s. In addition to algorithmic innovations, the increase in computing capabilities using GPUs and the collection of larger datasets are all factors that helped in the recent surge of deep learning.

## 3.1. Artificial Neural Networks (ANNs)

Artificial neural networks (ANNs) are a family of machine learning models inspired by biological neural networks.

### Artificial Neural Networks vs. Biological Neural Networks

Biological Neurons are the core components of the human brain. A neuron consists of a cell body, dendrites, and an axon. It processes and transmit information to other neurons by emitting electrical signals. Each neuron receives input signals from its dendrites and produces output signals along its axon. The axon branches out and connects via synapses to dendrites of other neurons.

A basic model for how the neurons work goes as follows: Each synapse has a strength that is learnable and control the strength of influence of one neuron on another. The dendrites carry the signals to the target neuron's body where they get summed. If the final sum is above a certain threshold, the neuron get fired, sending a spike along its axon.[1]

Artificial neurons are inspired by biological neurons, and try to formulate the model explained above in a computational form. An artificial neuron has a finite number of inputs with weights associated to them, and an activation function (also called transfer function). The output of the neuron is the result of the activation function applied to the weighted sum of inputs. Artificial neurons are connected with each others to form artificial neural networks.

### Feedforward Neural Networks

Feedforward Neural Networks are the simplest form of Artificial Neural Networks.

These networks have 3 types of layers: Input layer, hidden layer and output layer. In these networks, data moves from the input layer through the hidden nodes (if any) and to the output nodes.

Below is an example of a fully-connected feedforward neural network with 2 hidden layers. "Fully-connected" means that each node is connected to all the nodes in the next layer.

Note that, the number of hidden layers and their size are the only free parameters. The larger and deeper the hidden layers, the more complex patterns we can model in theory.

### Activation Functions

Activation functions transform the weighted sum of inputs that goes into the artificial neurons. These functions should be non-linear to encode complex patterns of the data. The most popular activation functions are Sigmoid, Tanh and ReLU. ReLU is the most popular activation function in deep neural networks.

### Training Artificial Neural Networks

The goal of the training phase is to learn the network's weights. We need 2 elements to train an artificial neural network:

• Training data: In the case of image classification, the training data is composed of images and the corresponding labels.
• Loss function: A function that measures the inaccuracy of predictions.

Once we have the 2 elements above, we train the ANN using an algorithm called backpropagation together with gradient descent (or one of its derivatives). For a detailed explanation of backpropagation, I recommend this article.

## 3.2. Convolutional Neural Networks (CNNs or ConvNets)

Convolutional neural networks are a special type of feed-forward networks. These models are designed to emulate the behaviour of a visual cortex. CNNs perform very well on visual recognition tasks. CNNs have special layers called convolutional layers and pooling layers that allow the network to encode certain images properties.

## Convolution Layer

This layer consists of a set of learnable filters that we slide over the image spatially, computing dot products between the entries of the filter and the input image. The filters should extend to the full depth of the input image. For example, if we want to apply a filter of size 5x5 to a colored image of size 32x32, then the filter should have depth 3 (5x5x3) to cover all 3 color channels (Red, Green, Blue) of the image. These filters will activate when they see same specific structure in the images.

## Pooling Layer

Pooling is a form of non-linear down-sampling. The goal of the pooling layer is to progressively reduce the spatial size of the representation to reduce the amount of parameters and computation in the network, and hence to also control overfitting. There are several functions to implement pooling among which max pooling is the most common one. Pooling is often applied with filters of size 2x2 applied with a stride of 2 at every depth slice. A pooling layer of size 2x2 with stride of 2 shrinks the input image to a 1/4 of its original size. [2]

## Convolutional Neural Networks Architecture

The simplest architecture of a convolutional neural networks starts with an input layer (images) followed by a sequence of convolutional layers and pooling layers, and ends with fully-connected layers. The convolutional layers are usually followed by one layer of ReLU activation functions.

The convolutional, pooling and ReLU layers act as learnable features extractors, while the fully connected layers acts as a machine learning classifier. Furthermore, the early layers of the network encode generic patterns of the images, while later layers encode the details patterns of the images.

Note that only the convolutional layers and fully-connected layers have weights. These weights are learned in the training phase.

# 4. Building a Cat/Dog Classifier using a Convolutional Neural Network

In this section, we will implement a cat/dog classifier using a convolutional neural network. We will use a dataset from Kaggle's Dogs vs. Cats competition. To implement the convolutional neural network, we will use a deep learning framework called Caffe and some Python code.

## 4.1 Getting Dogs & Cats Data

First, we need to download 2 datasets from the competition page: train.zip and test1.zip. The train.zip file contains labeled cats and dogs images that we will use to train the network. The test1.zip file contains unlabeled images that we will classify to either dog or cat using the trained model. We will upload our predictions to Kaggle to get the score of our prediction model.

## 4.2 Machine Setup

To train convolutional neural networks, we need a machine with a powerful GPU.

In this tutorial, I used one AWS EC2 instance of type g2.2xlarge. This instance has a high-performance NVIDIA GPU with 1,536 CUDA cores and 4GB of video memory, 15GB of RAM and 8 vCPUs. The machine costs \$0.65/hour.

If you're not familiar with AWS, this guide will help you set up an AWS EC2 instance.

Please note, that the AMI recommended in the guide is no longer available. I prepared a new AMI (ami-64d31209) with all the necessary software installed. I also created a guide for installing Caffe and Anaconda on an AWS EC2 instance or an Ubuntu machine with GPU.

After setting up an AWS instance, we connect to it and clone the github repository that contains the necessary Python code and Caffe configuration files for the tutorial. From your terminal, execute the following command.

Next, we create an input folder for storing the training and test images.

## 4.3 Caffe Overview

Caffe is a deep learning framework developed by the Berkeley Vision and Learning Center (BVLC). It is written in C++ and has Python and Matlab bindings.

There are 4 steps in training a CNN using Caffe:

• Step 1 - Data preparation: In this step, we clean the images and store them in a format that can be used by Caffe. We will write a Python script that will handle both image pre-processing and storage.
• Step 2 - Model definition: In this step, we choose a CNN architecture and we define its parameters in a configuration file with extension .prototxt.
• Step 3 - Solver definition: The solver is responsible for model optimization. We define the solver parameters in a configuration file with extension .prototxt.
• Step 4 - Model training: We train the model by executing one Caffe command from the terminal. After training the model, we will get the trained model in a file with extension .caffemodel.

After the training phase, we will use the .caffemodel trained model to make predictions of new unseen data. We will write a Python script to this.

## 4.4 Data Preparation

We start by copying the train.zip and test1.zip (that we downloaded to our local machine) to the inputfolder in the AWS instance. We can do this using the scp command from a MAC or linux machine. If you're running Windows, you can use a program such as Winscp. After copying the data, we unzip the files by executing the following commands:

Next, we run create_lmdb.py.

create_lmdb.py script does the following:

• Run histogram equalization on all training images. Histogram equalization is a technique for adjusting the contrast of images.
• Resize all training images to a 227x227 format.
• Divide the training data into 2 sets: One for training (5/6 of images) and the other for validation (1/6 of images). The training set is used to train the model, and the validation set is used to calculate the accuracy of the model.
• Store the training and validation in 2 LMDB databases. train_lmdb for training the model and validation_lmbd for model evaluation.

Below is the explanation of the most important parts of the code.

transform_img takes a colored images as input, does the histogram equalization of the 3 color channels and resize the image.

make_datum takes an image and its label and return a Datum object that contains the image and its label.

The code above takes 5/6 of the training images, transforms and stores them in train_lmdb. The code for storing validation data follows the same structure.

### Generating the mean image of training data

We execute the command below to generate the mean image of training data. We will substract the mean image from each input image to ensure every feature pixel has zero mean. This is a common preprocessing step in supervised machine learning.

## 4.4 Model Definition

After deciding on the CNN architecture, we need to define its parameters in a .prototxt train_val file. Caffe comes with a few popular CNN models such as Alexnet and GoogleNet. In this tutorial, we will use the bvlc_reference_caffenet model which is a replication of AlexNet with a few modifications. Below is a copy of the train_val file that we call caffenet_train_val_1.prototxt. If you clone the tutorial git repository as explained above, you should have the same file under deeplearning-cats-dogs-tutorial/caffe_models/caffe_model_1/.

We need to make the modifications below to the original bvlc_reference_caffenet prototxt file:

• Change the path for input data and mean image: Lines 24, 40 and 51.
• Change the number of outputs from 1000 to 2: Line 373. The original bvlc_reference_caffenet was designed for a classification problem with 1000 classes.

We can print the model architecture by executing the command below. The model architecture image will be stored under deeplearning-cats-dogs-tutorial/caffe_models/caffe_model_1/caffe_model_1.png

## 4.5 Solver Definition

The solver is responsible for model optimization. We define the solver's parameters in a .prototxt file. You can find our solver under deeplearning-cats-dogs-tutorial/caffe_models/caffe_model_1/ with name solver_1.prototxt. Below is a copy of the same.

This solver computes the accuracy of the model using the validation set every 1000 iterations. The optimization process will run for a maximum of 40000 iterations and will take a snapshot of the trained model every 5000 iterations.

base_lr, lr_policy, gamma, momentum and weight_decay are hyperparameters that we need to tune to get a good convergence of the model.

I chose lr_policy: "step" with stepsize: 2500, base_lr: 0.001 and gamma: 0.1. In this configuration, we will start with a learning rate of 0.001, and we will drop the learning rate by a factor of ten every 2500 iterations.

There are different strategies for the optimization process. For a detailed explanation, I recommend Caffe's solver documentation.

## 4.6 Model Training

After defining the model and the solver, we can start training the model by executing the command below:

The training logs will be stored under deeplearning-cats-dogs-tutorial/caffe_models/caffe_model_1/model_1_train.log.

During the training process, we need to monitor the loss and the model accuracy. We can stop the process at anytime by pressing Ctrl+c. Caffe will take a snapshot of the trained model every 5000 iterations, and store them under caffe_model_1 folder.

The snapshots have .caffemodel extension. For example, 10000 iterations snapshot will be called: caffe_model_1_iter_10000.caffemodel.

### Plotting the learning curve

A learning curve is a plot of the training and test losses as a function of the number of iterations. These plots are very useful to visualize the train/validation losses and validation accuracy.

We can see from the learning curve that the model achieved a validation accuracy of 90%, and it stopped improving after 3000 iterations.

## 4.7 Prediction on New Data

Now that we have a trained model, we can use it to make predictions on new unseen data (images from test1). The Python code for making the predictions is make_predictions_1.py and it's stored under deeplearning-cats-dogs-tutorial/code. The code needs 4 files to run:

• Test images: We will use test1 images.
• Mean image: The mean image that we computed in section 4.4.
• Model architecture file: We'll call this file caffenet_deploy_1.prototxt. It's stored under deeplearning-cats-dogs-tutorial/caffe_models/caffe_model_1. It's structured in a similar way to caffenet_train_val_1.prototxt, but with a few modifications. We need to delete the data layers, add an input layer and change the last layer type from SoftmaxWithLoss to Softmax.
• Trained model weights: This is the file that we computed in the training phase. We will use caffe_model_1_iter_10000.caffemodel.

To run the Python code, we need to execute the command below. The predictions will be stored under deeplearning-cats-dogs-tutorial/caffe_models/caffe_model_1/submission_model_1.csv.

Below is the explanation of the most important parts in the code.

The code above stores the mean image under mean_array, defines a model called net by reading the deploy file and the trained model, and defines the transformations that we need to apply to the test images.

The code above read an image, apply similar image processing steps to training phase, calculates each class' probability and prints the class with the largest probability (0 for cats, and 1 for dogs).

After submitting the predicitions to Kaggle, it give an accuracy of 0.89691.

# 5. Building a Cat/Dog Classifier using Transfer Learning

In this section, we will use a very practical and powerful technique called transfer learning for building our cat/dog classifier.

## 5.1 What is Transfer Learning?

Convolutional neural networks require large datasets and a lot of computional time to train. Some networks could take up to 2-3 weeks across multiple GPUs to train. Transfer learning is a very useful technique that tries to address both problems. Instead of training the network from scratch, transfer learning utilizes a trained model on a different dataset, and adapts it to the problem that we're trying to solve.

There are 2 strategies for transfer learning:

• Utilize the trained model as a fixed feature extractor: In this strategy, we remove the last fully connected layer from the trained model, we freeze the weights of the remaining layers, and we train a machine learning classifier on the output of the remaining layers.
• Fine-tune the trained model: In this strategy, we fine tune the trained model on the new dataset by continuing the backpropagation. We can either fine-tune the whole network or freeze some of its layers.

For a detailed explanation of transfer learning, I recommend reading these notes.

## 5.2 Training the Cat/Dog Classifier using Transfer Learning

Caffe comes with a repository that is used by researchers and machine learning practitioners to share their trained models. This library is called Model Zoo.

We will utilize the trained bvlc_reference_caffenet as a starting point of building our cat/dog classifier using transfer learning. This model was trained on the ImageNet dataset which contains millions of images across 1000 categories.

We will use the fine-tuning strategy for training our model.

### Model Definition

The model and solver configuration files are stored under deeplearning-cats-dogs-tutorial/caffe_models/caffe_model_2. We need to make the following change to the original bvlc_reference_caffenet model configuration file.

• Change the path for input data and mean image: Lines 24, 40 and 51.
• Change the name of the last fully connected layer from fc8 to fc8-cats-dogs. Lines 360, 363, 387 and 397.
• Change the number of outputs from 1000 to 2: Line 373. The original bvlc_reference_caffenet was designed for a classification problem with 1000 classes.

Note that if we keep a layer's name unchanged and we pass the trained model's weights to Caffe, it will pick its weights from the trained model. If we want to freeze a layer, we need to setup its lr_multparameter to 0.

### Solver Definition

We will use a similar solver to the one used in section 4.5.

### Model Training with Transfer Learning

After defining the model and the solver, we can start training the model by executing the command below. Note that we can pass the trained model's weights by using the argument --weights.

### Plotting the Learning Curve

Similarly to the previous section, we can plot the learning curve by executing the command below. We can see from the learning curve that the model achieved an accuracy of ~97% after 1000 iterations only. This shows the power of transfer learning. We were able to get a higher accuracy with a smaller number of iterations.

### Prediction on New Data

Similary to section 4.7, we will generate predictions on the test data and upload the results to Kaggle to get the model accuracy. The code for making the predicitions is under deeplearning-cats-dogs-tutorial/code/make_predictions_2.py.

The model got an accuracy of 0.97154 which is better than the model that we trained from scratch.

# Conclusion

In this blog post, we covered core concepts of deep learning and convolutional neural networks. We also learned how to build convolutional neural networks using Caffe and Python from scratch and using transfer learning. If you want to learn more about this topic, I highly recommend Stanford's "Convolutional Neural Networks for Visual Recognition" course.

# References

## 原文链接

A Practical Introduction to Deep Learning with Caffe and Python


text:
# Calculate the unknown coordinates of a point $B (x_2,y_2)$ on a line with given distance from a known point $A(x_1,y_1)$

I have a line which represents a cross section. I have the coordinates of on its starting point. I need the coordinates of the end point of that cross section line. The distance between these two points is known. Is there some way to calculate it, or do I need some more information?

I want to calculate the unknown coordinates of end point $B (x_2,y_2)$ on a line with given distance from a known coordinates of starting point $A(x_1,x_2)$.

### Clarification

I have a cross section line AB with length of $2800$m. The start point $A(x_1,y_1,z_1)$ is known. $z_1$ is the bed elevation on point $A$. I need to calculate the coordinates at end point $B(x_2,y_2)$. Now there are two situations.

• Case 1: I have $z_2$ at point $B$ with me also.
• Case 2: I don't have $z_2$ on point $B$ with me.
• question is not clear. mind rephrasing it? – MonK Aug 26 '14 at 9:49
• i have a line which represents a cross section. I have the coordinates of on its starting point. I need the coordinates of the end point of that cross section line. The distance between these two points is known. is there some way to calculate it, or do i need some more information?? – hassan Aug 26 '14 at 9:54
• geometrical approach needs slop of the line – Vikram Aug 26 '14 at 10:01
• @ Vikram ok let me be more clear to my question. I have a cross section line AB with length of 2800m. The start point A(x1,y1,z1) is known.z1 is the bed elevation on point A. I need to calculate the coordinates at end point B(x2,y2). Now there are two situations. Case1: i have z2 at point B with me also. Case 2: i dont have z2 on point B with me. I need a formula suitbale for the solution of this problem. please help. – hassan Aug 26 '14 at 10:50
• @ MonK let me be more clear to my question. I have a cross section line AB with length of 2800m. The start point A(x1,y1,z1) is known.z1 is the bed elevation on point A. I need to calculate the coordinates at end point B(x2,y2). Now there are two situations. Case1: i have z2 at point B with me also. Case 2: i dont have z2 on point B with me. I need a formula suitbale for the solution of this problem. please help – hassan Aug 26 '14 at 11:03

Assuming no typo in what you wrote and that I properly understood (this does not seem to be sure according to the comments I received after my initial answer), if you have point $A$ $(x_1,x_2)$ and point $B$ $(x_2,y_2)$ the square of the distance is given by $$d^2=(x_1-x_2)^2+(x_2-y_2)^2$$

I am sure that you can take from here.

• 1 eqn, 2 unknowns, how? – Vikram Aug 26 '14 at 10:03
• @Vikram.As far as I understood, only $y_2$ is unknown. – Claude Leibovici Aug 26 '14 at 10:05
• Both $x_2,y_2$ are not known, infact the slope is unknown. – MonK Aug 26 '14 at 10:06
• @MonK. Read the post again. The OP says that point $A(x_1,x_2)$ is known and that point $B(x_2,y_2)$ is unknown but the distance is known. I assumed no typo in the question. Cheers :-) – Claude Leibovici Aug 26 '14 at 10:09
• @ClaudeLeibovici, B can be at any elevation , if A is origin then B can be any one of the points on the circle with center at origin, you travel the given distance, but in which direction? – Vikram Aug 26 '14 at 10:11

Let $(d)$ be the given line through unknown point $A(x_1, y_1)$. Then the parametric of $d$ has form $$x=x_0+ta; \quad y=y_0+tb\quad (t\in\mathbb{R}),$$ where $(a, b)$ is the direction vector of $(d)$ and $(x_0, y_0)$ is the point on $(d)$. Let $d$ be the given distance from a known point $B(x_2, y_2)$ to $A$. Solving the equation $$(x_0+ta-x_2)^2+(y_0+tb-y_2)^2=d.$$ We have three cases:

Case 1. The equation has no solution

Thẹn the distance from known point $B(x_2, y_2)$ to $(d)$ is greater than $d$ and so there is no point $A(x_1, y_1)$ on the line $(d)$ satisfying the given conditions.

Case 2. The equation has one solution

Then substitute the solution $t^*$ to the parametric form of $(d)$ we can find unknown point $A(x_1, y_1)$. The finding point is the projection from known point $B(x_2, y_2)$ to the line $(d)$.

Case 3. The equation has two distinct solutions

Then the distance from known point $B(x_2, y_2)$ to $(d)$ is less than $d$ and there are two point $A_1, A_2$ satissfying the given conditions. Substitute the solutions $t_1, t_2$ to the parametric form of $(d)$ we can find two unknown point $A_1(x^1_1, y^1_1)$ and $A_2(x^2_1, y^2_1)$.