text:
# B Why is the quadratic expression 20*x^2-1 only divisible by 11,19,29...

Tags:
1. Apr 13, 2017

### Janosh89

Ian in London (South).Interests Number Theory. Prime Numbers...
Integer iterations of this quadratic expression only yield decimal numbers whose factors end with the digit _1, or _9. Why?

2. Apr 13, 2017

### Staff: Mentor

Do you have any idea? Without the "-1", which is the last digit?

3. Apr 13, 2017

### Staff: Mentor

It is not so trivial if you want to consider all factors of the number. 13*23 can give the correct last digit, for example.

@Janosh89: Can you rule out some factors based on modular arithmetic?
Can you generalize that?

4. Apr 13, 2017

### Janosh89

The factors are in the set 11,19,29,31,41,59,61,71 and so on but can include prime numbers (^2), (^4),(^6)...

Last edited by a moderator: Apr 14, 2017
5. Apr 13, 2017

### Janosh89

299 (13*23) is not expressible by 20*x^2-1 ? where x is an integer

6. Apr 13, 2017

### Staff: Mentor

Yes, I erroneously thought it was about the digits of $20x^2-1$ itself.
Interesting question though and indeed not trivial.

7. Apr 14, 2017

### Janosh89

This is applicable to a sub-class of prime pairs, 59;61 say ,
45x^2 +15x +1
45x^2 +15x - 1 ( 5x^2+5x +/-1 where x=3*n )

8. Apr 14, 2017

### Janosh89

Hope you got my reply. Thanks very much for responce to my initial question.

9. Apr 14, 2017

### SlowThinker

I don't understand what this means. Is it another question, or an attempt at answering the original question?
For the original question, the first step is to write the equation modulo 10.

10. Apr 14, 2017

### Staff: Mentor

And how does that help?

The obvious approaches don't directly lead to a solution. While it is easy to rule out many specific primes as factors, that is not trivial to generalize.
This is an interesting problem. Please be careful with hints if you don't know if they help.

11. Apr 14, 2017

### SlowThinker

I think I have a proof, I just didn't want to post it.
In the first step I prove that factors must be 1,3 or 9 mod 10. In the second step I rule out those with 3 mod 10.

Edit: I guess I'll have to rule out 7 mod 10 as well...
Edit2: Yes the first step allows 7 mod 10 as well but second step can be repeated to rule those out as well.

Last edited: Apr 14, 2017
12. Apr 15, 2017

### Janosh89

13. Apr 15, 2017

### Janosh89

Thanks for signposting! Maybe it is more trivial, but
60*x^2+1 has only factors in the sets

30*n+1, +17, +19, +23

14. Apr 18, 2017

### Janosh89

45x2+15x +/-1. ... 59;61 ,209;211 ,449;451 ,779;781 ...
45x2-15x +/-1 ... 29;31 ,149;151 ,359;361 ,659;661 ....
have the same factors as 20x2-1

15. Apr 18, 2017

### Staff: Mentor

45*1383768138376181^2-15*1383768138376181-1 = 61 × 1 412567 897300 469698 405475 260189
45*1383768138376181^2-15*1383768138376181+1 = 11 × 7 833331 066848 059236 612180 988321
45*1383768138376181^2+15*1383768138376181-1 = 547 101119 × 157496 738249 823782 787361
45*1383768138376181^2+15*1383768138376181+1 = 86 166641 735328 693115 778142 156961 (prime)

45*332222111111111111113837681383761^2-15*332222111111111111113837681383761-1 = 41 × 15031 × 473798 391866 453915 014639 × 17 009998 181762 817836 249229 315400 436941
45*332222111111111111113837681383761^2-15*332222111111111111113837681383761+1 = 79 × 101 582219 × 2 051039 191429 × 301 752471 096290 191134 883798 553758 009803 236039
45*332222111111111111113837681383761^2+15*332222111111111111113837681383761-1 = 11 × 451519 900000 050505 057916 361767 462680 924222 331768 767051 457652 135169
45*332222111111111111113837681383761^2+15*332222111111111111113837681383761+1 = 4 966718 900000 555555 637079 979442 089490 166445 649456 437566 034173 486861 (prime, 67 digits)

It certainly generates large primes!

Edit: Found an alternative way to factorize the one nasty case.

Last edited: Apr 18, 2017
16. Apr 18, 2017

### Janosh89

You've made my evening. See you soon. Great!

Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted


text:
# Divide matrix using left division

In matlab, I defined

a=[1;2;3]
b=[4;5;6]

both a and b are not square matrix.

and execute a\b will return 2.2857

From various sources, we understand that a\b ~= inv(a)*b, but in my case, a is not a square matrix, thus we can't perform an inverse operation on it.

I am actually translating matlab code to c#, and I need to know how do left division between non-square matrix calculated.

Thanks!

In Matlab $a$\ $b =(a'a)^{-1}a'b$, i.e. $b$ is projected onto $a$.
A little bit more information: Consider, $$b \approx ax$$ where $x$ is unknown and there are no exact solutions i.e. $b$ and $a$ have many rows and few columns, then the typical way to solve this problem is to solve for $x$ by projecting $b$ onto $a$ or by taking the point on the space $a$, which is closest to be i.e. $b \approx P_ab=a(a'a)^{-1}a'b=ax$.

format: plain


text: Damian Rössler pointed out an essential obstruction which is in fact the only one: a holomorphic vector bundle $E$ is the pullback of the universal (quotient) bundle on a Grassmanian via a holomorphic map if and only if $E$ is generated by a finite number of holomorphic global sections. The point is that unlike the $C^\infty$ case, a holomorphic bundle need not have any nonzero global sections at all.


text:
# The derivation of fractional equations

Recently I saw some physical problems that can be modeled by equations with fractional derivatives, and I had some doubts: is it possible to write an action that results in an equation with fractional derivatives? For example, consider a hypothetical physical system with the principle of least action. Is there a "wave equation" with the time-derivative $3/2$? Does such a question make sense?

When I've seen fractional derivatives I've assumed that one place where they would naturally arise is in physical situations where there's a fractional dependency on time.

For example, random walks typically result in movement proportional to $\sqrt{t}$. Googling for "fractional+derivative+random+walk" on arxiv.org finds some papers that explore this:

• Dear @space_cadet, no, what you write is not correct. QGR is right that whenever fractional derivatives appear, the action is nonlocal. It's enough for some terms to appear, whether they're leading or not, and the action has to be nonlocal. At the end of your answer, you admit that you don't really know why they're nonlocal. Well, it's because the you may write $\partial_t^k$ as $E^k$ in the Fourier transformed energy representation, and the transformation of the operator $E^k$ back to the $t$ basis is nonlocal. – Luboš Motl Jan 27 '11 at 17:19
• @space_cadet, a fraction derivative is a simple example of "pseudo-differential operator". It's an operator that can be easily defined for example with fourier transform (like Lubos Motl sayed). You can define operator that in Fourier Transform is equivalent to $\sin{k}$...Fraction derivative is simpler, in Fourier Transform is a multiplication for your transform variable $k$ with fractional exponent ;-) – Boy Simone Jan 28 '11 at 12:36


text:
B. Emotes
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

There are $n$ emotes in very popular digital collectible card game (the game is pretty famous so we won't say its name). The $i$-th emote increases the opponent's happiness by $a_i$ units (we all know that emotes in this game are used to make opponents happy).

You have time to use some emotes only $m$ times. You are allowed to use any emotion once, more than once, or not use it at all. The only restriction is that you cannot use the same emote more than $k$ times in a row (otherwise the opponent will think that you're trolling him).

Note that two emotes $i$ and $j$ ($i \ne j$) such that $a_i = a_j$ are considered different.

You have to make your opponent as happy as possible. Find the maximum possible opponent's happiness.

Input

The first line of the input contains three integers $n, m$ and $k$ ($2 \le n \le 2 \cdot 10^5$, $1 \le k \le m \le 2 \cdot 10^9$) — the number of emotes, the number of times you can use emotes and the maximum number of times you may use the same emote in a row.

The second line of the input contains $n$ integers $a_1, a_2, \dots, a_n$ ($1 \le a_i \le 10^9$), where $a_i$ is value of the happiness of the $i$-th emote.

Output

Print one integer — the maximum opponent's happiness if you use emotes in a way satisfying the problem statement.

Examples
Input
6 9 2
1 3 3 7 4 2

Output
54

Input
3 1000000000 1
1000000000 987654321 1000000000

Output
1000000000000000000

Note

In the first example you may use emotes in the following sequence: $4, 4, 5, 4, 4, 5, 4, 4, 5$.


text:
# Describing continuous functions

I wanna describe all the continuous functions from set $\mathbb{N}$ with metric $d(x,y) = |\dfrac{{1}}x - \dfrac{{1}}y|$ to $\mathbb{R}$ with the usual metric (|x-y|). I've done proving a function is continuous before, but not describing. Here's my line of thought: let f be an arbitrary continuous function at x $\in N$, $\forall \epsilon>0, \exists \delta>0$ so that if $d_\mathbb{N}(x,y) = |1/x - 1/y| < \delta$ then $d_\mathbb{R}(f(x),f(y)) = |f(x) - f(y)| < \epsilon$. I'm stuck.

-In another way, is it true to say the metric in N acts like a discrete space and hence, any function is continuous?

• What are m and n? Shouldn't this be x and y?
– user370967
Feb 20 '18 at 22:49
• mistyping. edited
– Jack
Feb 20 '18 at 22:51
• What happens if your argument tends to infinity? One may think of $\mathbb{N}$ equipped with your metric as of a subset of $\{\frac{1}{n} \; : \; n\in \mathbb{N} \} \subset \mathbb{R}$ with standard euclidean metric. Feb 20 '18 at 22:52
• If you are given any $x\in\mathbb{N}$, there is a $\delta$ such that the only element $y\in \mathbb{N}$ with $d(x,y)<\delta$ is $x$ itself. From this follows that every function (no matter where to) is continuous at $x$. Feb 20 '18 at 22:53
• Not every function from a netric space into a metric space is continuous. For example there are plenty of non-contunuous functions from and to the real line (usual metric). Feb 20 '18 at 22:57

A metric space $X$ is discrete if for every point $x\in X$ there is a $\delta_x$ such that $\{y\in X\mid d_X(y,x)<\delta_x\}=\{x\}$.
Observe that every function defined on a discrete metric space is continuous: for every point $x$ and every $\varepsilon>0$, you can choose $\delta=\delta_x$ as above. Then if $d_X(x,y)<\delta_x$ then $x=y$ and hence $|f(x)-f(y)|=0<\varepsilon$.
Now we only need to check that $\mathbb N$ with the the metric you provided is discrete: given $x$, you can choose $\delta_x:= \frac 1{(x+1)x}$. Indeed if $x\leq y$ and $\frac 1x-\frac 1y< \frac 1{(x+1)x}$ then $(x+1)y-(x+1)x< y$, i.e. $x+1> y$, therefore $x=y$. Similarly if $x\geq y$ and $\frac 1y - \frac 1x<\frac 1{(x+1)x}<\frac1{(x-1)x}$ then $(x-1)x-(x-1)y<y$, i.e. $(x-1)<y$; therefore $x=y$.


text:
Help on an integral

I can't figure out how to compute the following integral: $$\int_{-\infty}^{+\infty}\frac{\mathrm{d}z}{\sqrt{(x^2+y^2+z^2)^3}}$$ I think I should do some substitution, but I didn't figure it out. Can you please give me a hint?

According to Mathematica the result should be $$\left[\frac{z}{(x^2+y^2)\sqrt{x^2+y^2+z^2}}\right]_{-\infty}^{+\infty}=\frac{2}{x^2+y^2}$$

Thank you very much for your effort.

• $z = \sqrt{x^2+y^2}\sinh t$ – Daniel Fischer May 6 '14 at 19:56
• thanks :-) I'll try that if you think this is the way to go. If I'm not wrong, this way I'll have to integrate $\frac{1}{(\sinh t)^{3/2}}$. Well I was afraid of that but I think I see how it should be done now – Tom83B May 6 '14 at 19:59
• Another option is $z=\sqrt{x^2+y^2} \tan{t}$. – Ron Gordon May 6 '14 at 20:00
• @Tom83B You get something simpler, fortunately. – Daniel Fischer May 6 '14 at 20:01

Subbing $z=\sqrt{x^2+y^2} \tan{t}$, the integral becomes
$$\frac1{x^2+y^2}\int_{-\pi/2}^{\pi/2} dt \, \frac{\sec^2{t}}{\sec^3{t}} = \frac1{x^2+y^2}\int_{-\pi/2}^{\pi/2} dt \,\cos{t} = \frac{2}{x^2+y^2}$$
Let $z=\sqrt{x^2+y^2}\tan\theta$, then $dz=\sqrt{x^2+y^2}\sec^2\theta\ d\theta$. \begin{align} \int_{-\infty}^{+\infty}\frac{dz}{\sqrt{(x^2+y^2+z^2)^3}}&=\int_{\Large-\frac\pi2}^{\Large\frac\pi2}\frac{\sqrt{x^2+y^2}\sec^2\theta\ d\theta}{\sqrt{((x^2+y^2)+(x^2+y^2)\tan^2\theta)^3}}\\ &=\int_{\Large-\frac\pi2}^{\Large\frac\pi2}\frac{\sqrt{x^2+y^2}\sec^2\theta}{\sqrt{(x^2+y^2)^3}\sqrt{(1+\tan^2\theta)^3}}d\theta\\ &=\int_{\Large-\frac\pi2}^{\Large\frac\pi2}\frac{\sec^2\theta\ }{\sqrt{(x^2+y^2)^2}\sec^3\theta}d\theta\\ &=\int_{\Large-\frac\pi2}^{\Large\frac\pi2}\frac{\cos\theta\ }{x^2+y^2}d\theta\\ &=\left.\frac{1}{x^2+y^2}\sin\theta\right|_{\Large-\frac\pi2}^{\Large\frac\pi2}\\ &=\frac{2}{x^2+y^2}. \end{align} Since $\tan\theta=\dfrac{z}{\sqrt{x^2+y^2}}$, then $\sin\theta=\dfrac{z}{\sqrt{x^2+y^2+z^2}}$. Hence $$\left.\frac{1}{x^2+y^2}\sin\theta\right|_{\Large-\frac\pi2}^{\Large\frac\pi2}=\left.\frac{1}{x^2+y^2}\cdot\dfrac{z}{\sqrt{x^2+y^2+z^2}}\right|_{-\infty}^{\infty}=\frac{2}{x^2+y^2}.$$


text:
# Show that ${\frac{x_1^{n}+x_2^{n}+…+x_n^{n}}{x_1x_2…x_n} + \frac{\sqrt[n]{x_1x_2…x_n}}{x_1+x_2+…+x_n}}\ge{n+\frac{1}{n}}$

Let $n\in\mathbb{N}$ such that ${n}\ge{0}$.

Show that ${\frac{x_1^{n}+x_2^{n}+...+x_n^{n}}{x_1x_2...x_n}+\frac{\sqrt[n]{x_1x_2...x_n}}{x_1+x_2+...+x_n}}\ge{n+\frac{1}{n}}$
when $x_n$ is positive.

I thought I can use AM GM inequality, but if I try to break it in two smaller pieces and apply AMGM I obtained a false affirmation for $\frac{\sqrt[n]{x_1x_2...x_n}}{\ x_1+\ x_2+...+x_n}$. Any help please?

• I think you need $n>0$ and the numerator of second term in LHS must be an $n$th root. Otherwise it is easily shown to be false. Please check. – Macavity Mar 7 '18 at 12:20
• I don't know how to make the numerator $\n$. Please help me. – Septimiu Cristian Mar 7 '18 at 12:54
• Type \sqrt[n] in math mode. – Chris Custer Mar 7 '18 at 13:00
• Thanks. I modified it. – Septimiu Cristian Mar 7 '18 at 13:02

Since the inequality is homogeneous you can assume that $x_1x_2...x_n=1.$ Let $x_1^n+x_2^n+...x_n^n = A$ and $x_1+x_2+...x_n = B$ for simplicity. Then, you have some easy inequalities: $$A\geq B\geq n$$ and $A\geq \dfrac{B^n}{n^{n-1}},$ the power mean inequality. Therefore, $$n\left(A+\dfrac{1}{B}\right)\geq \dfrac{B^n}{n^{n-2}}+\dfrac{n}{B}=n^2\left(\dfrac{B^n}{n^{n}}\right)+\dfrac{n}{B}\geq(n^2+1)\left(\dfrac{B^{n^3-1}}{n^{n^3-1}}\right)^{\frac{1}{n^2+1}}\geq n^2+1.$$


text:
## Calculus with Applications (10th Edition)

$$0$$
The x-axis can be written as $$y=0$$ The equation of a line in slope-intercept form is $$y=mx+b$$ where $m$ is the slope and $b$ is the y-intercept. So, in this case $$m=0$$because there is no $x$ term.


text:
12:38 AM
0

Proposal: Hyphenatecrossedprodcuts. Reason: Hyphenation improves readability, and is standard practice.

2 hours later…
3:00 AM
@Feeds My vote would be to remove the tag, rather than hyphenate it.
The tag originates with this question, which is the only question with that tag.
Would anyone be upset if I simply removed that tag?

5 hours later…
7:44 AM
0

Let $X$ be the circle $\mathbb{R}/\mathbb{Z}$ and let $R_{\theta}(x) = x + \theta$ mod $1$ be the rotation by an irrational angle $\theta$. Prove that the Lebesgue measure $\mu$ is ergodic. This is taken from Foundations of ergodic theory by Viana and Oliveira. I have found a few different proof...

Since consensus on meta seems to be towards removal of the tag, I have removed it from this question.

3 hours later…
11:08 AM
@MartinSleziak The tag was created again in this question: Is this an example of a valid coinduction proof? (It was recently deleted by the OP.)

3 hours later…
2:28 PM
A new tag was created by user122424.
0

Is anybody aware what means here on the page 307, -3rd paragraph the acronym "framework of F. of S." ? I.e. what the letters F. and S. stand for ?

2 hours later…
4:12 PM
@MartinSleziak That seems really unlikely to be useful in my opinion. I've removed it.


text:
# Resolve the rational function (-3x^6 +9x^5 -12x^4 +18x^3 -22x^2 +14x -6)/(x^4 -3x^3 +4x^2 -3x +1) into partial fractions.

Since the order of polynomial found at numerator is larger than the order of poynomial at denominator, you need to perform the division of polynomials, using long division, such that:

`(-3x^6 +9x^5 -12x^4 +18x^3 -22x^2 +14x -6)/(x^4 -3x^3 +4x^2 -3x +1) = -3x^2 + (9x^3-19x^2+14x-6)/(x^4 -3x^3 +4x^2 -3x +1)`

You...

Start your 48-hour free trial to unlock this answer and thousands more. Enjoy eNotes ad-free and cancel anytime.

Since the order of polynomial found at numerator is larger than the order of poynomial at denominator, you need to perform the division of polynomials, using long division, such that:

`(-3x^6 +9x^5 -12x^4 +18x^3 -22x^2 +14x -6)/(x^4 -3x^3 +4x^2 -3x +1) = -3x^2 + (9x^3-19x^2+14x-6)/(x^4 -3x^3 +4x^2 -3x +1)`

You need to use the partial fraction decomposition to convert the given fraction into partial irreducible fractions, hence, you need to convert the original form of denominator into its factored form.

You should notice that `x = 1` represents a solution to the equation `x^4 -3x^3 +4x^2 -3x +1 = 0` , hence, you may write the denominator, such that:

`x^4 -3x^3 +4x^2 -3x +1 = (x - 1)(ax^3 + bx^2 + cx + d)`

`x^4 -3x^3 +4x^2 -3x +1 = ax^4 + bx^3 + cx^2 + dx - ax^3 - bx^2 - cx - d`

`x^4 -3x^3 +4x^2 -3x +1 = ax^4 + x^3(b - a) + x^2(c - b) + x(d - c) - d`

Equating the coeffcients of like powers yields:

`a = 1`

`b - a = -3 => b - 1 = -3 => b = -2`

`c - b = 4 => c = 4 + b => c = 4 - 2 => c = 2`

`-d = 1 => d = -1`

`x^4 -3x^3 +4x^2 -3x +1 = (x - 1)(x^3 - 2x^2 + 2x - 1)`

You need to convert the factor `x^3 - 2x^2 + 2x - 1` into its factored form, such that:

`x^3 - 2x^2 + 2x - 1 = (x^3 - 1) - 2x(x - 1)`

`x^3 - 2x^2 + 2x - 1 = (x - 1)(x^2 + x + 1) - 2x(x - 1)`

Factoring out `x - 1` , yields:

`x^3 - 2x^2 + 2x - 1 = (x - 1)(x^2 + x + 1 - 2x)`

`x^3 - 2x^2 + 2x - 1 = (x - 1)(x^2 - x + 1)`

Hence, converting the denominator into its factored form yields:

`x^4 -3x^3 +4x^2 -3x +1 = (x - 1)(x - 1)(x^2 - x + 1)`

The factor `x^2 - x + 1` cannot be decomposed any further.

You need to use partial fraction decomposition, such that:

`(9x^3-19x^2+14x-6)/((x - 1)^2(x^2 - x + 1)) = a/(x - 1) + b/(x - 1)^2 + (cx + d)/(x^2 - x + 1)`

`9x^3-19x^2+14x-6= a(x - 1)(x^2 - x + 1) + b(x^2 - x + 1) + (cx + d)(x^2 - 2x + 1)`

`9x^3-19x^2+14x-6= a(x^3 - x^2 + x - x^2 + x - 1) + bx^2 - bx + b + cx^3 - 2cx^2 + cx + dx^2 - 2dx + d`

`9x^3-19x^2+14x-6= ax^3 - ax^2 + ax - ax^2 + ax - a +bx^2 - bx + b + cx^3 - 2cx^2 + cx + dx^2 - 2dx + d`

Grouping the terms that contain the same power of `x` , yields:

`9x^3-19x^2+14x-6= x^3(a + c) + x^2(-a + b - 2c + d) + x(2a - b + c - 2d) - a + b + d`

Equating the coefficients of like powers yields:

`a + c = 9 => a = 9 - c`

`-a + b - 2c + d = -19 => c - 9 + b - 2c + d = -19 => -c + b + d = -10`

`2a - b + c - 2d = 14 => 18 - 2c - b + c - 2d = 14 => -c - b - 2d = -4`

`- a + b + d = -6 => c - 9 + b + d = -6`

You need to solve for `b,c,d` the following system such that:

`{(-c + b + d = -10),(-c - b - 2d = -4),(c + b + d = 3):} => -d = -1 => d = 1`

`2b + 2 = -7 => 2b = -9 => b = -9/2`

`c = 3 + 9/2 - 1 => c = 13/2`

`a = 9 - c =>a = 9 - 13/2 => a = 5/2`

`(9x^3-19x^2+14x-6)/((x - 1)^2(x^2 - x + 1)) = 5/(2(x - 1)) - 9/(2(x - 1)^2) + ((13/2)x + 1)/(x^2 - x + 1)`

Hence, decomposing the given fraction into partial fractions, yields ` (-3x^6 +9x^5 -12x^4 +18x^3 -22x^2 +14x -6)/(x^4 -3x^3 +4x^2 -3x +1) = -3x^2 + 5/(2(x - 1)) - 9/(2(x - 1)^2) + ((13/2)x + 1)/(x^2 - x + 1).`

Approved by eNotes Editorial Team


text:
# project-sheeko/sheeko-vagrant

No description, website, or topics provided.
Python Other
1. Python 99.2%
2. Other 0.8%
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
data_preparation
evaluation
inference
library
train
Vagrantfile
installation.sh
sheeko_demo_1.jpg
sheeko_demo_2.jpg
sheeko_demo_3.jpg
sheeko_demo_4.jpg
sheeko_demo_5.jpg
show_and_tell.jpg

# Sheeko Project

Machine learning implementation package to generate descriptive metadata for digitized historical images. The project is funded through the LYRASIS Catalyst grant.

## PROJECT OVERVIEW

This project provides deployable machine learning environment including pre-trained models and code packages for training, inference and evaluation for generating caption metadata. Inference codes for label generating (classification, object detect) are also included in this project.

### Introduction

Inference Example for given image

Caption:

a bird sitting on top of a wooden bench . (p=0.001655)

Label:

jay
indigo bunting, indigo finch, indigo bird, Passerina cyanea
magpie
pill bottle
water ouzel, dipper
Bird

### Architecture

This code package is the customization of Im2txt. Please see https://github.com/tensorflow/models/tree/master/research/im2txt for more details about im2txt

Architecture of Caption generating model in this project is "Show and Tell model" which is an encoder-decoder neural network.

## GETTING STARTED

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

### Prerequisites

There're two ways deploying this project on your platform.

1. Deploy locally. Windows and Linux OS are supported.
1. Deploy in VirtualBox

Difference between these two ways:

• Deploy locally could maximize your GPU acceleration. This is useful when performing training and evaluation
• Deploy in VirtualBox could run the script without doing additional installation and for sure it's cross-platform.

You could deploy the project in both ways so you could get best performance in all functionalities.

#### To deploy in Virtualbox

• Virtualbox Installed

• vt-x enabled

• Vagrant Installed

### Installation

#### To Install Locally

It's recommened to run the code in Ubuntu 16.04.6 LTS OS or Windows OS environment. Make sure you have tensorflow-gpu and CUDA tookit installed to enable GPU accleration. Installation for tensorflow-gpu is not covered in this document.

• Run the script to see python version. Make sure python is installed properly.
python -V

• For Windows OS

Install the required packages listed above.

To install punkt, run python script:

import nltk

• For Linux OS

if you have the permission for sudo, run script under project root directory:

bash installation.sh

Otherwise install the required packages listed same as Windows OS.

#### Use VirtualBox

This code package is supported using vagrant. Virualbox and vt-x option need to be enabled in BIOS mode.

Please be aware that there is limitation for GPU allocation in VirtualBox environment. So It's not recommended to run either training or evaluation script in VirtualBox.

Alternatively, if you plan to run training or evalutaion, please deploy the code package locally.

• Download code package and run the script under project root directory through command line

vagrant up

it will take few minutes if you running this script at the first time. It will create the VM and install all pakcages on the VM.

After the script is done, the vagrant box is up, and you may notice that VM "sheeko_project" is created. OS inside the VM is Ubuntu 16.04.6 LTS OS

### Test Installation

If you deploy the code project in VM, you need to check installation inside the VM. Otherwise you can skip this step.

• 1.Start up and enter vagrant box
vagrant up
vagrant ssh

• 2.Run following scripts to test packages installation
python -c 'import tensorflow as tf; print(tf.__version__)'

Version of the tensorflow will be printed as result if successfully installed

python -c 'import nltk; print(nltk.__version__)'

Version of the nltk will be printed as result if successfully installed

## HOW TO USE

### Execute script

This code package is executed through Command Line. To run the script, you need to navigate to the directory of the script then run the script using "python script_name.py".

Here's an example:

cd /path/to/project/dir/data_preparation
python validate_data_run.py

### Configure File

To make the script work, you need to configure the scripts with the information needed.

Basically you need to configure the fields within the block in each script.

Here's an example:

-------------------configuration start here-----------------------------------------------------------------------
# Field name in annotation file containing metadata
FIELD_NM = "caption"
# Field name in the annotation file containing the image file name
FIELD_ID = "image_id"

# List of paths (relative or absolute) of directories containing the annotation files
CAPTION_DIR_LIST = ['clean/demo_1', 'clean/demo_2']

# Path to output directory
OUTPUT_PATH = "build"

# Segment method: seg_by_image, seg_by_dir
SEG_METHOD ='seg_by_image'

# Training set percent in int
TRAIN_PERCENT = 80
-------------------configuration end here-----------------------------------------------------------------------

### OS Compatibility

If you plan to run the script under Windows OS, path format with "\".

e.g. CHECKPOINT_PATH = "path\to\dir\pretrained_model\graph.pb"

If Linux OS, path format with "/".

e.g. CHECKPOINT_PATH = "path/to/dir/pretrained_model/graph.pb"

You could easily switch between Linux OS and Windows OS by replacing "\" with "/" or replacing "/" with "\" .

When using a model, check the checkpoint file: Here's an example: model_checkpoint_path: "/vagrant/models/caption/train/model.ckpt-20"

If you're planning to migrate this model, make sure you adjust the path correctly to prevent the "Not Found" error. If you're running the code under Windows OS, you need to adjust the path by changing / with \.

When you run build_data_run.py: check the annotation file generated in annotation.json. Here's an example in : "file_name": "/vagrant/data_preparation/data/demo_2/128269.jpg" If you plan to run build_TF_run.py with this data in Windows OS or if data has been moved somewhere else. You have to run run build_data_run.py under Windows OS with the updated configuration and use the new dataset for your purpose to prevent "Not Found" error.

## WALKTHROUGH

### What's included in the package

• Data Preparation
• Training
• Evaluation
• Inference

In this section we're going to demo how to perform the inference and how to get your own model

To make the script work, we need to configure the code file.

Please see configuration for details.

### Inference Walkthrough

#### 1. First we need to get the pretrained models, you could skip this if you have trained your own model already.

See our pretrained models website to download our pretrained models.

In our walkthrough For caption inference we use the ptm-im2txt-incv3-mlib-cleaned-3m which is trained on MSCOCO dataset (http://cocodataset.org) with 3 million steps.

For classification: Here's the resource you could download the models and labels https://github.com/googlecodelabs/nest-tensorflow/tree/master/tmp/imagenet

For object detection: Here's the resource you could download the models and labels https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/detection_model_zoo.md https://github.com/tensorflow/models/tree/master/research/object_detection/data

In our demo we use faster_rcnn_inception_resnet_v2_atrous_oid_2018_01_28 and oid_bbox_trainable_label_map.pbtxt

#### 2. Next let's get the test images for inference.

In our code package we provide a few demo images under test_image directory. Here we're using the demo images for inference.

#### 3. Caption Inference

Let's start with turn on vagrant box

vagrant up

vagrant ssh

Now let's do the the caption inference.

the project directory is also the shared folder with the Virutalbox and that means you could edit the file either inside the VM or locally. In VM, the path the project is under /vagrant/.

For example: in vagrant box, Open /vagrant/inference/caption/caption_inference_test.py and configure the following fields:

1. CHECKPOINT_PATH. Path to the directory containing the checkpoint file (pre-trained model)
1. VOCAB_FILE. Path to the Vocabulary Dictionary file
1. IMAGE_FILE. Path to the JPEG image file to generate caption

You could also locate the file under the project_directory/inference/caption/caption_inference_test.py

Here's an example of configuration under linux OS (vagrant).

'''Path to the directory containing the checkpoint file (pre-trained model)'''
CHECKPOINT_PATH="../../models/caption/mscoco2017_3M/train"

# Vocabulary Dictionary file generated by the preprocessing script.
VOCAB_FILE = "../../models/caption/mscoco2017_3M/word_counts_mscoco.txt"

# Path to the JPEG image file to generate caption
IMAGE_FILE = "../../test_image/sheeko_demo_4.jpg"

Then we need to navigate to caption_inference_test located directory and run the script

cd /vagrant/inference/caption

python caption_inference_test.py

So we get the following results printed

  0) a cow standing in a field of grass . (p=0.000430)
1) a cow is standing in a field of grass . (p=0.000424)
2) a cow standing in a field of grass (p=0.000283)

caption_inference_run.py has the similar fields to configure. There's slight diference that it loop over all images under the each directory in the list and generate the captions. Also instead of printing out the results, it creates a JSON file containing of the results generated.

Here's an example of configuration under linux OS (vagrant).

# List of paths to directories containing JPEG image files to caption.
# The script will grab all JPEG in specified directories.
# No need to mention files individually.
# This will only grab images place directly in the directories. It will not go into child dirs.
IMAGE_DIR_LIST = ["../../test_image"]

# Path to output json file
OUTPUT_PATH = "output/captions.json"

After running the script, the results will be stored in JSON file located at output/captions.json.

Feel free to do inference with your own images. However, this model is not perfect for doing inference for all images.

e.g. the sheeko_demo_1.jpg the result generated says it's a bird standing on the top of the wooden branch.

#### 4. Classification Inference

Now let's do the the classification labels inference.

Open /vagrant/inference/classification/classify_image_test.py and configure the following fields:

1. CHECKPOINT_PATH. Path to the directory containing the checkpoint file (pre-trained model)
1. VOCAB_DIR. Path to the directory containing Vocabulary Dictionary file
1. IMAGE_FILE. Path to the JPEG image file to generate caption

You could also locate the file under the project_directory/inference/classification/classify_image_test.py

Here's an example of configuration under linux OS (vagrant).

# Path to pretrained model graph.pb file
CHECKPOINT_PATH = "../../models/labels/classification/classify_image_graph_def.pb"

# Path to vocabulary directory that containing pbtxt and txt dictionary file.
VOCAB_DIR = "../../models/labels/classification"

# Path to the JPEG image file to generate label
IMAGE_FILE = "../../test_image/sheeko_demo_4.jpg"

Then we need to navigate to classify_image_test located directory and run the script

cd /vagrant/inference/classification

python classify_image_test.py

So we get the following results printed

ox (score = 0.89056)
oxcart (score = 0.03067)
water buffalo, water ox, Asiatic buffalo, Bubalus bubalis (score = 0.00574)
hog, pig, grunter, squealer, Sus scrofa (score = 0.00301)
lakeside, lakeshore (score = 0.00288)

similar to caption_inference_run.py, classify_image_run.py also stored generated results in JSON File.

Here's an example of configuration under linux OS (vagrant).

# Path to pretrained model graph.pb file
CHECKPOINT_PATH = "../../models/labels/classification/classify_image_graph_def.pb"

# Path to vocabulary directory that containing pbtxt and txt dictionary file.
VOCAB_DIR = "../../models/labels/classification"

# List of paths to JPEG image files to labels
# The script will grab all JPEG in specified directories.
# No need to mention files individually.
# This will only grab images place directly in the directories. It will not go into child dirs.
IMAGE_DIR_LIST = ["../../test_image"]

# Path to output json file
OUTPUT_PATH = "output/classifications.json"

After running the script, the results will be stored in JSON file located at output/classifications.json.

#### 5. Object Detection Inference

Now let's do the the object detect labels inference.

Open /vagrant/inference/object_detect/object_detect_test.py and configure the following fields:

1. CHECKPOINT_PATH. Path to the directory containing the checkpoint file (pre-trained model)
1. VOCAB_FILE. Path to Vocabulary Dictionary file
1. IMAGE_FILE. Path to the JPEG image file to generate caption

You could also locate the file under the project_directory/inference/object_detect/object_detect_test.py

Here's an example of configuration under linux OS (vagrant).

# Path to pretrained model graph.pb file
CHECKPOINT_PATH = "../../models/labels/object_detect/models/faster_rcnn_inception_resnet_v2_atrous_oid_2018_01_28/frozen_inference_graph.pb"

# Path to label mapping pbtxt file
VOCAB_FILE = "../../models/labels/object_detect/vocab/oid_bbox_trainable_label_map.pbtxt"

# Path to the JPEG image file to generate label
IMAGE_FILE = "../../test_image/sheeko_demo_4.jpg"

Then we need to navigate to object_detect_test located directory and run the script

cd /vagrant/inference/object_detect

python object_detect_test.py

Since object detect is GPU usage consuming, it's slower to run it under vagrant box. If you plan to do inference for multiple images, it's recommended to run the script locally.

Notice in vagrant box, gpu acceleration is limited, so for training purpose we use local deployed code pakcage as demo

In this case we need to exit vagrant box, run code in command line

exit

logout
Connection to 127.0.0.1 closed.

then you run

cd /path/to/project/dir/inference/object_detect

python object_detect_test.py

Here's the result:

[{'score': '0.72273505', 'label_text': u'Cattle'}, {'score': '0.3564907', 'label_text': u'Animal'}, {'score': '0.34420493', 'label_text': u'Furniture'}]

similar to caption_inference_run.py, object_detect_run.py also stored generated results in JSON File.

Here's an example of configuration under linux OS (vagrant).

# Path to pretrained model graph.pb file
CHECKPOINT_PATH = "path/to/dir/pretrained_model/graph.pb"

# Path to label mapping pbtxt file
VOCAB_FILE = "path/to/dir/pretrained_model/label_map.pbtxt"

# List of paths to JPEG image files to caption. It's no longer needed since image_dir is used to grab all images inside to generate the captions, for legacy testing, please go to research/im2tx test_model.py
IMAGE_DIR_LIST = ["path/to/dir/"]

# Path to output json file
OUTPUT_PATH = "path/to/output/object_detect.json"

After running the script, the results will be stored in JSON file located at OUTPUT_PATH.

### Train your own model Walkthrough

#### 1. The first thing for your training is always about the data.

Please see Data Prepartion Section for details. Here to make the demo faster, we use the provided data under data_prepartion/data. Under data directory both annotation files and JPEG images are provided.

#### 2. Clean and Structure your data

Most time the data you get is always not clean, so cleaning actually takes most of the time for your training. Here we provide the code to do the trick. It cleans up your data by removing proper-noun (See Clean Data for how it works) and also structures your data into training and testing sets. (See Build Data for how it works)

You could skip data cleaning if you already have the clean data.

Open /vagrant/data_preparation/clean_data_run.py and configure the following fields:

1. FIELD_NM. Field name in annotation file containing metadata
1. DATA_DIR_LIST. List of directories containing annotation files that will process data cleaning
1. OUTPUT_PATH. Path to output directory
1. DATA_DIR. This is alternative way for providing list of directories, you could loop over the given root directory

You could also locate the file under the project_directory/data_preparation/clean_data_run.py

Here's an example of configuration under linux OS (vagrant). Here we loop over data directory, so all directories under "data" will be processed.

# Field name in annotation file containing metadata
FIELD_NM = "description_t"

# Example of looping all dirs under given path
DATA_DIR = 'data'

for dir in os.listdir(os.path.abspath(DATA_DIR)):
if os.path.isdir(os.path.abspath(os.path.join(os.path.abspath(DATA_DIR),dir))):
DATA_DIR_LIST.append(DATA_DIR + '/' + dir)

# Path to output directory
OUTPUT_PATH = "clean"

Then we need to navigate to clean_data_run located directory and run the script

cd /vagrant/data_preparation/

python clean_data_run.py

After running the script, the clean annotation files will be stored under "clean".

Once we've got the clean data needed. We could now structure our data into the format for training.

Open build_data_run.py and configure the fields:

1. FIELD_NM. Field name in annotation file containing metadata
1. FIELD_ID. Field name in annotation file containing image id matching image file name.
1. IMAGE_DIR_LIST. List of directories containing image files.
1. CAPTION_DIR_LIST. List of directories containing annotations files.
1. OUTPUT_PATH. Path to output directory
1. DATA_DIR. This is alternative way for providing list of directories, you could loop over the given root directory
1. SEG_METHOD. Segment method: seg_by_image, seg_by_dir.
1. TRAIN_PERCENT. Integer of percent to put into training data set. The rest of data will go the test set.

Here we put the cleaned annotations file along with the image files in the build_data_run.py.

# Field name in annotation file containing metadata
FIELD_NM = "caption"
# Field name in the annotation file containing the image file name
FIELD_ID = "image_id"

# List of paths (relative or absolute) of directories containing the annotation files
CAPTION_DIR_LIST = ['clean/demo_1', 'clean/demo_2']
# List of paths (relative or absolute) of directories containing the images
IMAGE_DIR_LIST = ['data/demo_1', 'data/demo_2']

# Path to output directory
OUTPUT_PATH = "build"

# Segment method: seg_by_image, seg_by_dir
SEG_METHOD ='seg_by_image'

# Training set percent in int
TRAIN_PERCENT = 80

Run the script:

python build_data_run.py

The structured data is stored under "build". Next we need to convert data into TF Record.

#### 3. Convert Data into TF Records

To make data runnable by training script, we need to convert the images and captions into TF records which are serial image-caption pairs.

Open /vagrant/data_preparation/build_TF_run.py and configure the following fields:

1. TRAIN_SET_IMAGE. Path to directory containing training set images
1. TEST_SET_IMAGE.Path to directory containing testing set images
1. TRAIN_SET_CAPTION. Path to training set annotation file
1. TEST_SET_CAPTION. Path to testing set annotation file
1. OUTPUT_PATH. Path to output directory

You could also locate the file under the project_directory/data_preparation/build_TF_run.py

# Path to directory containing training set images
TRAIN_SET_IMAGE = "build/train/images"
# Path to directory containing testing set images
TEST_SET_IMAGE = "build/test/images"
# Path to training set annotation file
TRAIN_SET_CAPTION = "build/train/annotations/annotation.json"
# Path to testing set annotation file
TEST_SET_CAPTION = "build/test/annotations/annotation.json"

# Path to output directory
OUTPUT_PATH = "TF"

Then we need to navigate to build_TF_run located directory and run the script

cd /vagrant/data_preparation/

python build_TF_run.py

After running the script, the TF Records will be stored under "TF".

#### 4. Now, let's run training for caption model

Finally we can train our own model for generating caption. We need to provide an inception checkpoint file. In this walkthrough we use

Open /vagrant/train/caption_train_run.py and configure the following fields:

1. DATA_DIR. Path to directory containing the saved training TF files
1. VOCAB_FILE. Path to dictionary file generated through TF build script
1. INCEPTION_CHECKPOINT. Path to Inception checkpoint file
1. MODEL_DIR. Directory to save or restore the training process of trained model
1. TRAIN_STEPS. Number of Steps to train
1. GPU_DEVICE. Gpu device to train your model, use integer number to refer to the device. Default set to 0

You could also locate the file under the project_directory/train/caption_train_run.py

# Path to directory containing the saved training TF files
DATA_DIR = "../data_preparation/TF"

# Path to dictionary file generated through TF build script
VOCAB_FILE = "../data_preparation/TF/word_count.txt"

# Path to Inception checkpoint file.
INCEPTION_CHECKPOINT = "../models/inception_v3.ckpt"

# Directory to save or restore the training process of trained model.
MODEL_DIR = "../models/caption"

# Number of Steps to train
TRAIN_STEPS = 20

# Select gpu device to train your model, use integer number to refer to the device: e.g. 0 -> gpu_0
GPU_DEVICE = 0

Here we just run 20 steps (which can do nothing for performance) to create a demo model as example. However you could continue the training by running the script (unless you change MODEL_DIR).

Notice in vagrant box, gpu acceleration is limited, so for training purpose we use local deployed code pakcage as demo

In this case we need to exit vagrant box, run code in command line

exit

logout
Connection to 127.0.0.1 closed.

then you run

cd /path/to/project/dir/train

python caption_train_run.py

After running the script, the model file will be stored under "models/caption/train". Under the model directory you will find model files including:

• 1.checkpoint file containing path to the model. If you plan to migrate your model or run the code under different OS environment, see Model Adjust
1. graph.pbtxt
1. model.ckpt-n.data-00000-of-00001
1. model.ckpt-n.index
1. model.ckpt-n.meta

#### 5. Run Inference

Now you could do the same thing as Caption Inference

#### 6. Run Evaluation

For NLG models, there're a few metrics for evaluation.

In our code package we use perplexity to measure the performance.

Here instead of using the model we just trained since we just trained it for 20 steps, we use ptm-im2txt-incv3-mlib-cleaned-3m model instead for evaluation. Download the models under /path/to/project/dir/models/caption

Open /vagrant/evaluation/caption_eval_run.py and configure the following fields:

1. DATA_DIR. Path to directory containing the saved evaluate TF files
1. MODEL_DIR. Directory containing model files to evaluate.
1. GPU_DEVICE. Gpu device to evaluate your model, use integer number to refer to the device. Default set to 0

You could also locate the file under the project_directory/evaluation/caption_eval_run.py

# Path to directory containing the saved evaluate TF files
DATA_DIR = "../data_preparation/TF"

# Directory containing model files to evaluate.
MODEL_DIR = "../models/caption/mscoco2017_3M/train/"

# Select gpu device to evaluate your model, use integer number to refer to the device: e.g. 0 -> gpu_0
GPU_DEVICE = 0

Notice in vagrant box, gpu acceleration is limited, so for evaluation purpose we use local deployed code pakcage as demo

In this case we need to exit vagrant box (if you are vagrant box), run code in command line

exit

logout
Connection to 127.0.0.1 closed.

then you run

cd /path/to/project/dir/evaluation

python caption_eval_run.py

## DATA PREPARATION

Data from any source for caption generating model need following the required pattern.

Both images files in JPEG format and descriptive annotation files in json format are required.

• JPEG image
• JSON annotation file containing metadata of caption associated with JPEG image

#### JSON Annotation File Example

[
images:[{
"file_name": "/vagrant/data/dc_bpc/125853.jpg", "id": 57870
}, ...
]
annotations:[{  id: 1,  image_id: 57870,  file_name: "COCO_train2014_000000000009.jpg"  caption: "a cat and dog on wooden floor next to a stairwell."}, ...
]

The sheeko pretrained models are trained using the data source below:

### Clean Data

This step is not required if your data set is clean and doesn't contain any noise (e.g. proper-noun). In this section we're removing proper-noun type noises using spaCy based NLP process in data set.

#### Toolkit

API: spaCy

Model: en_core_web_sm

#### What does it do?

• Remove proper-noun noise

• Simplify annotation file by leaving image_id and metadata field only

• Save cleaned annotation file in the destination directory following the same directory structure

• Create data report in JSON format under destination directory

• valid metadata: total number of captions that have valid JPEG images found and got non empty result after NLP process
• dir name: /path/to/data/dir,
• none pronoun: total number of captions that have valid JPEG images found and are proper-noun noise free
• pronoun: total number of captions that have valid JPEG images found and have proper-noun noise
• data count: total number of captions that have valid JPEG images found

#### Neuro-linguistic programming (NLP) Steps

##### step 1: PRONOUN cleaning
• 1.1 replace named person with "person"

example: Mary Jane with daughters --> a person with daughters

• 1.2 remove DATE, TIME, ORG, GPE, LOC, PRODUCT, EVENT, WORK ART, LAW, LANGUAGE, FAC, NORP, PERCENT, MONEY, QUANTITY, ORIGINAL
and get their parent node, if there's no parent node, then abort this sentence)

example: A women group is photographed at the Ashley Power Plant up Taylor Mountain road --> A women group is photographed

##### step 2: Parent nodes cleaning
• 2.1 if the parent node is 'DET', 'NOUN', 'NUM', 'PUNCT', 'CCONJ', 'VERB', remove the subtrees nodes of the lefts if it's not in the list
• 2.2 if the parent node is PREP or other types, remove the nodes and their children nodes

example: A woman tends to a fire at a Ute Indian camp near Brush Creek. --> A woman tends to a fire at a camp .

##### step 3: NOUN entities cleaning
• 3.1 replace the chunk of non-named enties chunk with simple entity along with CC, CD, DT and IN
• 3.2 replace CD type number with string value, e.g. 3, three

example: Ute couple with child stand in front of old cars --> couple with child stand in front of cars

##### step 4: Reform
• 4.1 put person entity and chunk replacement in position
• 4.2 replace person entities with understandable words, e.g. ,if multiple people then use num people instead, e.g. "a person" "two people", else say "a group of people"
• 4.3 replace nums of person entities (>=3) replace with "a group of " + noun
• 4.4 remove the tokens with index in indexes list of the sentence and convert the array to sentence

### Build Data

#### Description

Formatted data in structure is required for the package. To create format data we need to go through build data section.

#### What does it do?

• Filter data set by getting data that have both images and associating annotation only
• Segment images and annotation files into training and testing data sets
• Resize image to trainable format into training and testing data set
• Build annotation file for training and testing data set
##### Segment Mode

We provide two segment methods:

1. segment all data through out all directories as one into training and testing data set.

2. segment the list of directories into training and testing sets.

• seg_by_image segment data set in each directory with given percentage of data into training set, the rest into test

• seg_by_dir segment directories with given percentage into training set, the rest of directories into test

#### Steps

• Make clear the purpose: Training, Inference or Evaluation
• Prepare your data according to the purpose
• Make sure you have enough space in the output directory to store the output result ( 6 X of original data set in file size)

#### For particular purpose

##### For Training
• Prepare images file in JPG format (single file size no more than 15 mb) and associating annotation files in JSON format. Structure your data: image file name has to be unique id and annotation file has to has the same image_id of image file name (e.g. 15376.jpg, annotation: "image_id": 15376 )
• Structure your data: annotation files have to use the consistent field for getting metadata (e.g. "description_t")
##### For cleaning up proper-noun and data noise in your annotation file by using clean_data_run.py and configure field name of metadata field, list of paths to annotation files and output directory, for more details, please see Data Cleaning page.
• Configure arguments in build_data_run.py (field names in annotation file, list of paths to annotation files and image files, output directory and data segmentation args, e.g. method and training set percentage ) Run build_data_run.py
• Formatted data will be available in the directory you specified as OUTPUT_PATH in build_data_run.py
• For im2txt captioning model training. Run build_TF_run.py to generating TF Records. Each image object contains "file_name" and "id". Each annotation object contains "id", "image_id" and "caption". Each image object may refers to multiple caption objects
• TF Records will be located under OUTPUT_PATH which is runnable data for the training
##### For Inference
• Prepare images file for inference in JPG format
• Prepare checkpoint file of model and corresponding vocabulary file
• Configure arguments in build_data_run.py (field names in annotation file, list of paths to annotation files and image files and output directory)
• Run build_data_run.py
• Inference results will be stored in OUTPUT_PATH in caption_infer.py

### Build TF Records

To make data runnable by training script, data need to be converted into TF Record format. Each TF record represents serial pairs of encoded image-caption data. Please see Convert Data into TF Records in Walkthrough section to see details.

## TRAINING A MODEL

Our code package provides the code to train your customized model for generating captions.

### Keys to get a good model

Here're the keys for getting a good models: 1). Data 2). Steps to train your model

Data quality and labels in dictionary decide what your model finally outouts.

Total number of training steps will decide whether your model will be underfitted or overfitted. Unfortunately here's no tutorial telling you how many steps you need to configure for getting that right point since that depends on your data. In our experience from im2txt, 3 million steps is getting the good model for MSCOCO data.

### Accelerate your training

GPU with higher memory can accelerate your training. This code package doesn't support multi-GPU training. However, you could do parallel training with multi-GPU. Specify the GPU by assigning the index of GPU. e.g. 1

### Initial Training

To run the training, an Inception model is required. You could download Inception v3 , See training walkthrough for details.

### Fine Tune the im2txt Model

You could transfer your training with new dataset. The output will follow the new dataset's pattern. Convert new dataset into TF Records then replace the DATA_DIR with the TF Records' path.

## INFERENCE

### Image Caption

Caption model translates given JPEG image into natural language text.

### Image Classification

Classification model translates given JPEG image into single label out of 1000 classes

### Object Detection

Object Detection model identifies the objects in the given JPEG image. You could find models here

Please see Inference Walkthrough for code walkthrough

## EVALUATION CAPTION MODEL

Code package provides evaluation script for caption model.

### Metric

Caption model is Natural-language generation model(NLG model). For NLG model, see metrics to measure performance.

In our code package we use perplexity as our metric to measure model's performance

Go to Evaluation Walkthrough for code walkthrough

## SHEEKO PRETRAINED MODELS RESOURCE

This project provides Sheeko Pretrained Models Resource for generating captions. Models with description are available for downloading. It's highly recommended to try the downloaded model in Inference Walkthrough to test the performance.

You can’t perform that action at this time.


text:
Exotic spectrum of Laplace operator - MathOverflow most recent 30 from http://mathoverflow.net 2013-05-19T05:38:43Z http://mathoverflow.net/feeds/question/91397 http://www.creativecommons.org/licenses/by-nc/2.5/rdf http://mathoverflow.net/questions/91397/exotic-spectrum-of-laplace-operator Exotic spectrum of Laplace operator Alex 2012-03-16T17:57:00Z 2012-03-19T13:03:47Z
Given a closed Riemannian manifold and a generalized Laplace $\Delta$ operator, it is well known that $\Delta$ has discrete spectrum $(\lambda_n)_n$ (arranged in a increasing way, not counting multiplicities). By a (consequence of a) result of Colin de Verdière, given any finite strictly increasing sequence $a_1,\cdots,a_k$ of strictly positive numbers, there exists a Riemannian manifold and a Laplace operator on it such that the first k+1 eigenvalues are exactly, $0,a_1,\cdots,a_k$.

My question is about what's happening at infinity. More precisely, since usually the spectrum of a Laplace operator is a quadratic polynomial (in the sense that {$\lambda_n : {n\geq 0}$} is of the form {$P(n) : n\geq 0$} where $P$ is a quadratic polynomial), is there a Laplace operator (on a closed manifold) such that there is no $n_0$ such that {$\lambda_n : {n\geq n_0}$} is of the form {$P(n) : n\geq 0$} where $P$ is a quadratic polynomial ?

My question could be reformulated : do you know example where the explicit (exact) eigenvalues (not asymptotics of them) are (after a certain rank) not given by a formula of the form $a n^2 + bn +c$ where $a,b,c$ are constants (for example some kind of fraction P(n)/Q(n) where the degree of P is 3 and the degree of Q is one...)

[Edit : precisions]
 http://mathoverflow.net/questions/91397/exotic-spectrum-of-laplace-operator/91416#91416 Answer by Renato G Bettiol for Exotic spectrum of Laplace operator Renato G Bettiol 2012-03-16T21:43:43Z 2012-03-18T15:37:40Z
Regarding the asymptotic behavior of the spectrum of the Laplacian (or, as the OP puts it, the behavior at infinity), the most basic result is Weyl's asymptotic formula (see Chavel's book, p.172): let $(M,g)$ be a compact manifold with $\dim M=n$ and $0=\lambda_0<\lambda_1\leq \lambda_2\leq\dots$ be the eigenvalues of the Laplacian, each distinct eigenvalue repeated according to its multiplicity. Denote by $N(\lambda)=\sum_{\lambda_j\leq\lambda} 1$ the number of eigenvalues (counted with multiplicity) that are $\leq\lambda$. Then

$$N(\lambda)\sim vol(M,g)\frac{vol(B^n)}{(2\pi)^n}\lambda^{n/2}, \quad \mbox{as} \quad\lambda\to+\infty,$$

where $vol(B^n)=\frac{\pi^{n/2}}{\Gamma(n/2+1)}$ is the volume of the unit ball of $\mathbb R^n$. In particular,

$$(\lambda_k)^{n/2}\sim\frac{(2\pi)^n}{vol(B^n)}\frac{k}{vol(M,g)}, \quad \mbox{as}\quad k\to+\infty.$$

Thus, the asymptotic behavior of the eigenvalues cannot be prescribed - it has to satisfy the above.

Also, as far as I understand, Colin de Verdière's result is stronger than stated. Namely, given any compact connected manifold M, with $\dim M\geq 3$, and any finite sequence $0\leq a_1\leq\dots\leq a_k$, there exists a Riemannian metric on $M$ such that the first eigenvalues in the spectrum of its Laplacian are $0\leq a_1\leq\dots\leq a_k$.
 http://mathoverflow.net/questions/91397/exotic-spectrum-of-laplace-operator/91566#91566 Answer by Liviu Nicolaescu for Exotic spectrum of Laplace operator Liviu Nicolaescu 2012-03-18T19:37:48Z 2012-03-18T19:37:48Z
For a generic metric on an $m$-dimensional the manifold the eigenvalues of the Laplacian are all simple. Fix such a metric and denote the coresponding eigenvalues by

$$\lambda_1, \lambda_2,\cdots$$

Using Weyl's asymptotic expansion we conclude that

$$\lambda_n\sim const . n^{2/m}.$$

Thus for any polynomial $P$ of degree $>1$ we have

$$\lim_{n\to\infty} \lambda_n/P(n) = 0.$$


text:
# GMS:Vertical Markov Chain

T-PROGS
T-PROGS
Strike Dip Markov Chain
Vertical Markov Chain
TSIM

A dialog assists in defining the vertical Markov chains. This dialog is composed of three main sections:

• Plot section
• Markov Chains section

All three sections enable developing a 1-D Markov chain in the vertical direction.

Vertical Markov Chain dialog.

## Plot section

The plot section includes the array of curves, the Lag spacing edit field, the Compute button, and the Max lag distance for plots edit field. The number of plots in the array produced correlates to the number of materials used in the simulation. If N materials are used, an N by N array of plots will illustrate the transition probabilities for each material with respect to every other material. Every plot is labeled with a name and units and can be maximized with a command in the menu produced by right-clicking on the curve in question. The curves are automatically regenerated anytime a change is made in the other sections of the dialog.

Transition probability plot.

Each of the plots contains two curves depicting the transition probability. The dashed line represents the transition probability measured from the borehole data by the GAMEAS utility. In general, this curve represents the transition probability from material j to material k. The transition probability tjk(h) is defined by:

where x is a spatial location, h is the lag (separation vector), and j,k denote materials. The lag is defined by the Lag spacing item in the upper left corner of the Vertical (Z) Markov Chains dialog. The curve shown with the solid line is called a “Markov Chain”. The Markov Chains are used to formulate the equations used by T-PROGS to generate the multiple material sets during the simulation stage. The objective of this stage of the analysis is to fit the Markov Chain curves as accurately as possible to the measured transition probability curves. This process is similar to fitting a model variogram to an experimental variogram in a kriging exercise. The transition rates are adjusted to ensure a good fit between the Markov Chain model and the observed transition probability data.

Mathematically, a Markov Chain model applied to one-dimensional categorical data in a direction Φ assumes a matrix exponential form:

${\displaystyle T(h_{\Phi })=exp(R_{\Phi }h_{\Phi })}$

where Φ denotes a lag in the direction hΦ, and RΦ denotes a transition rate matrix

${\displaystyle R_{\Phi }={\begin{bmatrix}r_{11,\Phi }&\cdots &r_{1k,\Phi }\\\vdots &\ddots &\vdots \\r_{k1,\Phi }&\cdots &r_{kk,\Phi }\end{bmatrix}}}$

with entries rjk,Φ representing the rate of change from category j to category k (conditional to the presence of j) per unit length in the direction Φ. The transition rates are adjusted to ensure a good fit between the Markov Chain model and the observed transition probability data.

It should be noted that the self-transitional curves on the diagonal start at a probability of 1.0 and decrease with distance and the off-diagonal curves start at zero probability and increase with distance. In both cases, the curves eventually flatten out at some distance. The probability corresponding to the flat part of the curve represents the mean proportion of the material. All curves on a particular column should flatten out to the same proportion. The proportions are displayed in the lower left corner of the dialog. The point where a tangent line from the early part of the curves on the diagonal intersects the horizontal (lag distance) axis on each curve represents the mean lens length for the material. The mean lens lengths are shown just to the right of the mean proportions in the lower left part of the dialog. The slope at the beginning of each of the Markov Chains represents the transition rate. Together, the proportions, lens lengths, and transition rates define the Markov Chains.

Several methods are provided for fitting the Markov Chains to the measured transition probability curves. These methods are listed in the section of the dialog titled Markov Chains. By default, GMS automatically makes an attempt to fit the curves using the Edit maximum entropy factors option. In many cases, this fit is sufficiently accurate and we can proceed to the next step. However, it is often useful to explore the other options for fitting the curves.

If boreholes exist in the model, the Compute... button becomes undimmed. When clicking the Compute... button, the parameter files required for running GAMEAS are generated and GAMEAS is executed.

### GAMEAS

GAMEAS executable inside GMS interface.

GAMEAS is an algorithm that processes borehole data and determines geologic characteristics such as material proportions and transition probability curves in a given direction. A separate window displays the details of the GAMEAS run, which allows monitoring the output from the GAMEAS simulation.

When GAMEAS completes a successful run, the results, including the material proportions and transition probability curves from the measured data, are read into the corresponding data fields in the Vertical Markov Chain dialog. Furthermore, the transition rates which correspond to the slope of the transition probability curves when the lag equals 0 are interpolated from the measured data curves. In addition to running GAMEAS, the code parses through the borehole data and calculates the embedded transition probabilities and frequencies. These values are stored in arrays that correspond to options #2 and #3 in the Markov Chains section of the dialog.

### Lag

The Lag spacing determines how dense the curves are, and the Max lag distance for plots determines the range of the curves. The curves always range from 0 to the Max lag distance for plots horizontally, and they range from 0 to 1 vertically to honor probability constraints.

## Markov chains section

There are five alternate methods of generating Markov chains in this section (area in the Vertical Markov Chain dialog). These methods are in a radio-button configuration to allow changing from one method to another. Each of these five methods will be described.

### Edit the transition rates

With this option one can directly edit the array of transition rates that are listed in the Transition Rates section. This option is useful after selecting the Compute button and running GAMEAS because slopes can be inferred from the measured data curves. GAMEAS outputs transition probability curves. Transition rates used in this option correspond to the slope of the transition probability curve at a lag = 0. When reading the output from GAMEAS, the transition probability rates are interpolated as:

where r1, r2, and r3 are the slopes defined by a straight line from the origin out to lag1, lag2, and lag3 respectively. As the lag approaches zero, more weight should be given to the corresponding slope. Hence, a weight of 0.57, 0.29, and 0.14 were assigned to r1, r2, and r3 respectively. Once the slopes are computed for each entry in the matrix, the mean lengths for each category are computed by:

Regardless of which Markov Chain option is selected, the background row and column, Sand_w/_fines, is dimmed because the values in this row and column are automatically computed from the remaining entries by probability constraints of the background material. In addition, with this option selected, the Lens Length column is also dimmed because the lens lengths are automatically computed and updated from the diagonal terms in the Transition Rates spreadsheet. The diagonal terms of the Transition Rates spreadsheet must be negative to obey probability rules. With this data, this method produces an accurate fit between the measured (green) and the Markov chain (blue) curves at small lag spaces.

### Edit the embedded transition probabilities

This is a more intuitive method of generating Markov chains and is conducive to sites with and without data. It is conducive to sites with data because the embedded transition probabilities can be determined from the borehole data. When a simulation is initialized, if borehole data exist default embedded transition probabilities are computed from the borehole data. If borehole data do not exist, the embedded transition probabilities can be estimated with some basic geologic knowledge including the average mean lengths of each material for each direction and depositional trends.

With this option selected, the diagonal terms are dimmed because these values are derived from the values entered in the Lens Length column. Adjusting the proportions, lens lengths, or the off-diagonal terms in the Transition Rates spreadsheet alters the curves.

With this option, the spreadsheet in the lower right of the dialog represents the probability that the row material will transition to the column material moving vertically upwards in the +Z direction.

### Edit the embedded transition frequencies

This option is similar to option #2, except embedded transition frequencies populate the off-diagonal terms of the Transition Rates spreadsheet. Embedded transition frequencies are also computed from borehole data when a simulation is initialized if borehole data exist. Once again, this is an intuitive framework with geologic knowledge including average mean lengths and depositional trends.

### Edit maximum entropy factors

While this option can be used with borehole data, it is ideally suited for cases without borehole data. With this option, the user edits the proportions for all but the background material and the mean lens lengths for all materials. The lens lengths are used to populate the diagonal terms of the Transition Rates spreadsheet, and the maximum entropy factors fill the off-diagonal terms of the spreadsheet. The maximum entropy factors represent the ratio of the transition rate to the maximum entropy transition rate. A maximum entropy factor of 1.0 represents maximum disorder in depositional tendencies. A rate greater than 1.0 indicates that the two categories tend to occur next to each other. A factor less than unity would infer the opposite. This is an intuitive method of generating Markov chains and is conducive to all types of sites. This method enables logical incorporation of anisotropy into the model with the maximum entropy factors.

### Fit curves to a discrete lag

This option is only undimmed if a transition probability curve from measured data exists in memory. When this option is selected, the Lag # edit field is undimmed to allow entering the discrete lag the curves will be fit to.

This option produces Markov chains that are computed from the measured transition rates produced by GAMEAS. GAMEAS computes a set of transition probabilities at each specified lag. This option computes an array of transition rates from the slope of the curves generated by GAMEAS (green). The transition rates correlate to the shape of the curve from the origin to the specified lag number in the Lag # edit field. Therefore, the cells of all the spreadsheets in the dialog are dimmed because the values are inherited from the measured curves (green). The values in the spreadsheets change depending on the lag # entered. By adjusting the lag interval, an excellent fit can often be obtained.


text:
zbMATH — the first resource for mathematics

$$L^ 2$$ estimates for the finite element method for the Dirichlet problem with singular data. (English) Zbl 0561.65071
We consider the approximation by the finite element method of second order elliptic problems on convex domains and with homogeneous Dirichlet condition on the boundary. In these problems the data are Borel measures. Using a quasiuniform mesh of finite elements and polynomials of degree $$\leq 1$$, we prove that in two dimensions the convergence is of order h in $$L^ 2$$ and in three dimensions of order $$h^{1/2}$$.

MSC:
 65N15 Error bounds for boundary value problems involving PDEs 65N30 Finite element, Rayleigh-Ritz and Galerkin methods for boundary value problems involving PDEs 35J25 Boundary value problems for second-order elliptic equations
Full Text:
References:
 [1] Adams, R.A.: Sobolev spaces. New York: Academic Press 1975 · Zbl 0314.46030 [2] Babu?ka, I.: Error-bounds for the finite element method. Numer. Math.16, 322-333 (1971) · Zbl 0214.42001 · doi:10.1007/BF02165003 [3] Babu?ka, I., Aziz, A.K.: Survey lectures on the mathematical foundations of the finite element method. Section 6.3.6, Proc. of the Conf. on the Mathematical Foundations on the Finite Element Method. New York: Academic Press 1973 [4] Bonnans, J.F., Casas, E.: Contrôle de systèmes non lineaires comportant des contraintes distribuées sur l’état. Rapport INRIA no 300 (1984) [5] Casas, E.: Control of an elliptic problem with pointwise state constraints. SIAM J. Control Optimization (Submitted) · Zbl 0606.49017 [6] Ciarlet, P.G.: The finite element method for elliptic problems. Amsterdam: North-Holland 1978 · Zbl 0383.65058 [7] Grisvard, P.: Behavior of the solutions of an elliptic boundary value problem in a polygonal or polyhedral domain. In: Numerical Solution of Partial Differential Equations III (Sysnspade 1975) (B. Hubbard, ed.), pp. 207-274. New York: Academic Press 1976 [8] Ne?as, J.: Les méthodes directes en théorie des equations elliptiques. Paris: Masson 1967 [9] Rudin, W.: Real and complex analysis. New York: McGraw-Hill 1966 · Zbl 0142.01701 [10] Scott, R.: Finite element convergence for singular data. Numer. Math.21, 317-327 (1973) · Zbl 0255.65037 · doi:10.1007/BF01436386 [11] Scott, R.: OptimalL ? estimates for the finite element method on irregular meshes. Math. Comput.30, 681-697 (1976) · Zbl 0349.65060 [12] Stampacchia, G.: Le problème de Dirichlet pour les equations elliptiques du second ordre à coefficients discontinus. Ann. Inst. Fourier, Grenoble15, 189-258 (1965) · Zbl 0151.15401
This reference list is based on information provided by the publisher or from digital mathematics libraries. Its items are heuristically matched to zbMATH identifiers and may contain data conversion errors. It attempts to reflect the references listed in the original paper as accurately as possible without claiming the completeness or perfect precision of the matching.


text:
# Problem naming certain arrows in tikz-cd

There's something I'm doing wrong in a certain diagram, and I can't seem to figure out how to name an arrow that bends. Here's a MWE (both with the package tikzcd and tikz + library cd the same error appears:

\begin{tikzcd}
& & A\ar{dl}\arrow[dll, bend right] &\\
B & C\lar[dashed]{\exists!\Phi} & & D\ar[hook]{ul}\ar{dl}\\
& & E\ar[hook]{ul}\ar[ull, hook, bend left] &
\end{tikzcd}

I need to name the arrow A -> B, but whenever I type \arrow[dll, bend right "\psi"], for example, an error message comes up, indicating that no color named $\psi$ exists (yeah, weird).

How do I circumvent this problem? Thanks in advance.

Welcome to TeX-SE! You only forgot a comma, i.e. bend right and the label need to be separated by a comma. (If you want, we can delete these posts.)
\documentclass{article}


text:
#### Chapter 6 Elementary Functions

Section 6.5 Trigonometric Functions

# 6.5.2 Sine Function

In Module 5 the trigonometric functions were introduced in Section 5.6 on right triangles, for example by the relation

$\begin{array}{ccccc}\hfill \mathrm{sin}\left(\alpha \right)& \hfill =\hfill & \hfill \frac{\text{opposite side}}{\text{hypotenuse} ,}\hfill & \hfill \hfill & \hfill \hfill \end{array}$

and explained using the unit circle. Starting from this definition of $\mathrm{sin}\left(\alpha \right)$ we arrive at the sine function if we declare the angle $\alpha$ to be the independent variable of a function named $\mathrm{sin}$. This can be illustrated by means of a family of right triangles $ABC$ that are inscribed the unit circle, i.e. a circle with radius $r=1$, in a certain way.

If we start with the angle $\alpha ={0}^{\circ }$, corresponding to a triangle degenerated to a line segment, then the length of the line segment $\stackrel{‾}{BC}$ equals $0$. If we now rotate the point $B$ counterclockwise around the circle, then the angle $\alpha$ - and $\mathrm{sin}\left(\alpha \right)$ as well - increases until for $\alpha ={90}^{\circ }$ a maximum value ($\mathrm{sin}\left({90}^{\circ }\right)=1$) is reached. Afterwards, the angle $\alpha$ continues to increase while $\mathrm{sin}\left(\alpha \right)$ is starting to decrease again. For $\alpha ={180}^{\circ }$, the triangle $ABC$ is again degenerated to a line segment and $\mathrm{sin}\left({180}^{\circ }\right)=0$. If $\alpha$ further increases, the triangle "flips downwards" and the line segment $\stackrel{‾}{BC}$ is oriented parallel to the negative vertical line ($y$-axis), hence, its length is negative. For $\alpha ={270}^{\circ }$ the maximum negative value occurs, before $\alpha$ approaches $0$ again. At $\alpha ={360}^{\circ }$ the game starts again.
The figure above shows the graph of the sine function

$\mathrm{sin}:\mathrm{ }\left\{\begin{array}{ccc}\hfill ℝ& \hfill \to \hfill & \left[-1;+1\right]\hfill \\ \hfill \alpha & \hfill ⟼\hfill & \mathrm{sin}\left(\alpha \right)\hfill \end{array} .$

In contrast to the discussion so far, the angle $\alpha$ is plotted on the horizontal axis ($\alpha$-axis) in radian measure, used more commonly in this context, and not in degree measure.
Let us specify some of the most relevant properties of the sine function:
• The sine function is defined on the entire set of real numbers $ℝ$. Hence, ${D}_{\mathrm{sin}}=ℝ$. In contrast, the range only consists of the interval between $-1$ and $+1$, including these two endpoints: ${W}_{\mathrm{sin}}=\left[-1;+1\right]$.
• After certain measures, the graph of the since function repeats its shape exactly; in this context this is called the periodicity of the sine function. The period of the sine function is ${360}^{\circ }$ or $2\pi$. Mathematically, this relation can be expressed as

$\mathrm{sin}\left(\alpha \right)=\mathrm{sin}\left(\alpha +2\pi \right) .$

Just a quick look at the graph of the simple sine function suggests that we could use this function for the description of wave phenomena. However, to be able to use the full potential of the sine function a few parameters will be introduced. For example, the amplitude of the sine function can be amplified or damped by a so-called amplitude factor $A$, the frequency of the oscillation can be affected by a frequency-like factor $a$, and the entire path of the graph can be shifted to the left or to the right by a shifting constant $b$. Thus, the general sine function has the following form:

$f:\mathrm{ }\left\{\begin{array}{ccc}\hfill ℝ& \hfill \to \hfill & \left[-A;+A\right]\hfill \\ \hfill x& \hfill ⟼\hfill & f\left(x\right)=A\mathrm{sin}\left(\mathrm{ax}+b\right)\hfill \end{array} .$

##### Example 6.5.1
Let us consider a simple pendulum. A small, heavy weight swings freely in the gravitational field of the Earth at a long, very thin cord that is, for example, fixed at the ceiling of a (high) room. Under certain idealised conditions and for small values of the displacement angle $\phi$ from the rest position (the vertical axis), the relation between the angle $\phi$ and the independent variable $t$, i.e. the time, is described by a general sine function:

$\phi \left(t\right)=A \mathrm{sin}\left(\frac{2\pi }{T}t+b\right) .$

Here, $T$ denotes the so-called period of the pendulum, i.e. the period of time, required by the pendulum for a full oscillation.


text:
### Theory:

Practical problems are nothing but application-oriented word problem which involves mathematical operations (such as addition, subtraction, multiplication and division).

Practical problem not only deals with mathematical operations but also deals with vocabulary, phrases, and understanding the concept.

Here come some keys to crack word problems.

 Operation Symbol Keywords Example Addition $$+$$ add, sum, plus, total, increased by, in all, more than, together, and, both, combined, $$2$$ is increased by $$3 = 2 + 3 = 5$$.The combined value of $$4$$ and $$8$$ is $$4 + 8 = 12$$. Subtraction $$-$$ subtract, difference, minus, decrease, fewer than, how many are less, how much needed to, left, minus, reduced, remaining, take away $$5$$ fewer than $$7 = 7 - 5 = 2$$.$$13$$ is reduced from $$29$$. $$29 - 13 = 16$$ Multiplication $$×$$ multiply, by, product, times, of, (double ($$2×$$), triple ($$3×$$)) $$7$$ times of $$6$$. $$7 × 6 = 42$$Tripe the number $$8$$. $$3 × 8 = 24$$ Division $÷$ divide, quotient, as much, over, share equally, how many in each, parts, the ratio of, percent, separated, Share $$₹40$$ equally to $$8$$ people. $$40/8 = 5$$Ratio of $$10$$ and $$5$$. $$10/5 = 2/1$$.


text:
Class 11 - Maths - Trigonometric Functions - Angle on Circular System + NCERT 3.1 Answers. (Part-1)

The phrase "measuring the sides of a triangle" is how the word "trigonometry" is obtained from the Greek words "trigon" and "metron." The field was initially created to address triangle-related geometric issues. The surveyors who mapped out the new territories, the engineers, and other people studied it for navigation. Currently, numerous fields, including the science of seismology, the design of electrical circuits, the description of the condition of an atom, forecasting ocean tide heights, analysing musical tones, and many other things.

You should remember

1. In the sexagesimal system, we measure angles in degrees, minutes and seconds.

1 right angle = 90°

1° = 60′  (minute) and

1′ = 60′′ (second)

2. In the circular measure, we measure angles in radians.

Thus,

πc = 180°

3. If an arc of length l makes an angle $θ^c$ at the centre of a circle of radius r, we have

$θ = \frac{l}{r}$

4. A radian is a constant angle

5. If the length of an arc is equal to the circle's radius, then the angle subtended at the circle's centre will be one radian. One radian is denoted by $1^c$ and $1^c$ = 57° 16′ 22′′ c approximately.

Q1. Find the radian measures corresponding to the following degree measures:

(i) 25° (ii) – 47°30′ (iii) 240° (iv) 520°

(i) 25°

25° = $\frac{\pi}{180} \times 25 = \frac{5\pi}{36}$ radians

(ii) – 47°30′

= $–(47° + \frac{1}{2}°) = \frac{-95}{2}$

= $\frac{-95}{2} \times \frac{\pi}{180}$

= $\frac{-19\pi}{72}$

(iii) 240°

= $240 \times \frac{\pi}{180}$

= $\frac{4\pi}{3}$

(iv) 520°

= $520 \times \frac{\pi}{180}$

= $\frac{26\pi}{9}$

Q2. Find the degree measures corresponding to the following radian measures. (Use $\pi = \frac{22}{7}$)

(i) $\frac{11}{16}$

(ii) -4

(iii) $\frac{5\pi}{3}$

(iv) $\frac{7\pi}{6}$

(i) $\frac{11}{16}$

= $\frac{11}{16} \times \frac{180}{\pi}$

= $\frac{11}{16} \times \frac{180}{\frac{22}{7}}$

= $\frac{11}{16} \times \frac{180 \times 7}{22}$

= $\frac{315}{8}$

= $39\frac{3}{8}$

= 39°22′30′′

(ii) -4

= $-4 \times \frac{180}{\pi}$

= $-4 \times \frac{180}{\frac{22}{7}}$

= $-4 \times \times \frac{180 \times 7}{22}$

= $-\frac{2520°}{11}$

(iii) $\frac{5\pi}{3}$

= $\frac{5\pi}{3} \times \frac{180}{\pi}$

= 300°

(iv) $\frac{7\pi}{6}$

= $\frac{7\pi}{6} \times \frac{180}{\pi}$

= 210°

Q3. A wheel makes 360 revolutions in one minute. Through how many radians does it turn in one second?

Answer: No. of revolutions made by the wheel in 1 minute (60 secs) = 360

No. of revolutions in 1 second = 360/60 = 6

The wheel turns at an angle of 2π radian in one complete revolution.

In 6 complete revolutions, it will turn an angle of =  6 × 2π  = 12 π radian

Thus, in 1s, the wheel turns at an angle of 12π radian.

Q4. Find the degree measure of the angle subtended at the centre of a circle of radius 100 cm by an arc of length 22 cm.  (Use $\pi = \frac{22}{7}$)

l = 22 cm

θ = $\frac{l}{r}$ radians

θ = $\frac{22}{100} \times \frac{180}{π}$ degrees

θ = $\frac{126°}{10}$ = 12°26′

Q5. In a circle of diameter 40 cm, the length of a chord is 20 cm. Find the length of the minor arc of the chord.

r = 20cm

Thus the two radii and the chord forms an equilateral triangle.

∴  θ = 60° = $\frac{π}{3}$

l = rθ = $20 \times \frac{π}{3}$

l = $20\frac{π}{3}$

Q6. If in two circles, arcs of the same length subtend angles 60° and 75° at the centre, find the ratio of their radii.

Answer: Given, θ₁ = 60° and θ₂ = 75°

Let r₁ and r₂ be the two radii.

Since arc length(l) is equal and l = rθ

∴ r₁θ₁ = r₂θ₂

∴ $\frac{r₁}{r₂} = \frac{θ₂}{θ₁}$

= $\frac{75}{60} = \frac{5}{4}$

Thus the ratio is 5:4

Q7. Find the angle in radian through which a pendulum swings if its length is 75 cm and the tip describes an arc of length
(i) 10 cm
(ii) 15 cm
(iii) 21 cm

Answer: Since θ = $\frac{l}{r}$ radian
(i) l = 10 cm, r = 75 cm
θ = $\frac{10}{75}$ radian
θ = $\frac{2}{15}$ radian

(ii) l = 15 cm, r = 75cm
θ = $\frac{15}{75}$ radian
θ = $\frac{1}{5}$ radian

(iii) l = 21 cm, r = 75cm
θ = $\frac{21}{75}$ radian
θ = $\frac{7}{25}$ radian


text:
# nLab absolute colimit

### Context

#### Limits and colimits

limits and colimits

# Contents

## Idea

An absolute colimit is a colimit which is preserved by any functor whatsoever. In general this happens because the colimit is a colimit for purely “diagrammatic” reasons. The notion is most important in enriched category theory.

Of course, there is a dual notion of absolute limit, but it is used less frequently.

## Definitions

The term “absolute colimit” is actually used for two closely related, but distinct, notions.

### Particular absolute colimits

###### Definition

A particular colimit diagram in a particular category $C$ is an absolute colimit if it is preserved by every functor with domain $C$.

This definition makes sense also in enriched category theory: for any $V$, a weighted colimit in a particular $V$-enriched category $C$ is an absolute colimit if it is preserved by every $V$-functor with domain $C$.

Note, however, that a conical colimit? in a $V$-category $C$ may be preserved by all $V$-functors without being preserved by all unenriched functors on the underlying ordinary category $C_o$. Thus, for clarity we may speak of a colimit being $V$-absolute.

Generalizing in a different direction, absolute colimits in $Set$-enriched categories can be regarded as the particular case of postulated colimit?s in sites where the site has the trivial topology?.

### Weights for absolute colimits

###### Definition

For a given $V$, a weight $\Phi\colon D^{op} \to V$ for colimits is an absolute weight, or a weight for absolute colimits, if $\Phi$-weighted colimits in all $V$-categories are preserved by all $V$-functors.

Absolute colimits of this sort are also called Cauchy colimits. A $V$-category which admits all absolute colimits — that is, all $V$-weighted colimits whose weights are absolute – is called Cauchy complete. By the characterization below, it is equivalent to admit limits weighted by all weights mature for absolute limits.

## Characterizations

Both types of absolute colimits admit pleasant characterizations.

### Particular absolute colimits

For a particular cocone $\mu \colon F \to \Delta A$ under a functor $F\colon I\to C$ (all in the Set-enriched world), the following are equivalent:

• $\mu$ is an absolute colimiting cocone.

• $\mu$ is a colimiting cocone which is is preserved by the Yoneda embedding $C \hookrightarrow [C^{op},Set]$.

• $\mu$ is a colimiting cocone which is preserved by the representable functors $C(F(i),-)\colon C\to Set$ (for all $i\in I$) and $C(A,-)\colon C\to Set$.

• There exists $i_0\in I$ and $d_0\colon A\to F(i_0)$ such that

1. For every $i\in I$, $d_0 \circ \mu_i$ and $1_{F(i)}$ are in the same connected component of the comma category $(F(i) / F)$.
2. $\mu_{i_0} \circ d_0 = 1_{A}$.

The equivalence of the first two is basically because the Yoneda embedding is the free cocompletion of $C$. The third clearly follows from the second. The fourth follows from the third by inspecting exactly what preservation by those representables means in terms of colimits in Set (as is explained in more detail in the special case of absolute coequalizers). Finally, it is straightforward to check that the fourth implies that $\mu$ is colimiting, and it is clearly a property preserved by any functor.

Note that in particular, the fourth condition implies that $A$ is a retract of $F(i_0)$. Also, the first half of the fourth condition by itself characterizes absolute weak colimits.

It is also possible to prove directly that the third condition implies the first two, without extracting the fourth condition along the way. Namely, Let $B$ be the full subcategory of $C$ consisting of the objects $F(i)$ and $A$. Then $F$ defines a functor $I\to B$; call it $F'$. Note that $A$ is also the colimit of $F'$ in $B$. Moreover, by the equivalence of the first two conditions, $A$ is an absolute colimit of $F'$, since by hypothesis it is preserved by all representable functors out of $B$. Therefore, this colimit is in particular preserved by the inclusion $B\hookrightarrow C$, along with its composite with any functor out of $C$; so $A$ is an absolute colimit of $F$.

### Weights for absolute colimits

Let $V$ be a Bénabou cosmos and $J\colon K ⇸ A$ a $V$-profunctor. Then the following are equivalent:

• $J$ is a weight for absolute colimits (i.e. $J$-weighted limits in any $V$-category are preserved by all $V$-functors)

• $J$ has a right adjoint $J^*$ in the bicategory $V$-Prof.

• There is a weight $J^*\colon A ⇸ K$ such that $J$-weighted colimits coincide naturally with $J^*$-weighted limits.

## Examples

### Particular absolute colimits

Of course, every colimit weighted by a weight for absolute colimits is itself a particular absolute colimit. But it may also happen that a particuclar colimit may be absolute without all colimits of that shape being absolute. For example (in ordinary category theory, with $V=Set$):

We can also say something about non-examples.

• Initial objects (in $Set$-enriched categories) are never absolute. If $0$ is an initial object, then it is never preserved by the representable functor $C(0,-)\colon C \to Set$.

• Similarly, coproducts in $Set$-enriched categories are never absolute.

### Weights for absolute colimits

In ordinary $Set$-enriched category theory there are not very many weights for absolute colimits, but we have

In fact, this example is “universal,” in that an ordinary category is Cauchy complete iff it has split idempotents, although not every absolute colimit “is” the splitting of an idempotent. More precisely, the class of absolute $Set$-limits is the saturation of idempotent-splittings.

In enriched category theory there can be more types of absolute colimits. For instance:

New kinds of absolute (co)limits also arise in higher category theory.

• for (∞,1)-categories (enriched over $\infty$-groupoids), splitting of idempotents is a universal absolute colimit.

• in stable (∞,1)-categories (which are enriched, in the $(\infty,1)$-categorical sense, over the $(\infty,1)$-category of spectra), initial objects and pushouts are absolute, and therefore so are all finite colimits.

## References

Revised on February 1, 2014 09:10:30 by Urs Schreiber (89.204.130.13)