{% extends 'layouts/main.html' %} {% block title %}RNN{% endblock %} {% block content %}
RNN is a class of neural networks that uses an internal state (memory) to process a time-based sequence of inputs.
In order to run the dataset through a RNN model, the data needed to be normalized and converted from a 2 dimensional format to a 3 dimensional format. The 3 dimensional format required by the Long Short Term Memory (LSTM) layer includes a timestep dimension which refers to the time window that the LSTM uses for making predictions. Since the prediction model uses a walk-forward validation approach, the batch-size for the predicitons in the layer are is set to 1. After testing various RNN architectures, the architecture that generated the lowest RMSE was a simple architecture using 1 LSTM layer, 1 Dropout Layer, and 1 dense layer. A dropout layer was added to the model to prevent overfitting. This layer randomly ignores selected neurons during training. Using more complicated architectures caused overfitting on the training data and underfitting on the test data.
The number of epochs for the model was also tuned. As you can see in the box and whisker plot below, the optimal number of epochs during testing was found to be 4 epochs based on the RMSE that was generated. This plot was done using batch size of 1, but similar results were found using different batch sizes. The final parameter that was tuned was the timestep dimension, which controls how far back the RNN model will lookback when generating predictions. With an epoch hyperparameter of 4, I performed a grid search over various timesteps ranging from 1 to 16. Since the starting values for a neural network model differ each time it is run, I ran 10 experiments at each timestep and took the mean value. I then applied the trading strategy logic to determine which combination of timesteps hyperparameters for the daily low price model and daily high price model generated the greatest return. The table below shows the dollar returns per share for various timesteps. The optimal hyperparameters that generated the greatest return were the following:Final Model Hyperparameters
The trading strategy generated POSITIVE returns using the RNN predictions. However, these returns were ~50% less ($4.58 per share vs $8.11 per share) than using a simple 'Buy and Hold' strategy (Buy on Day 0 and sell at the end of the 3 months).
As you can see from the predictions vs actuals graphs, the RNN model overestimates the high and low prices in the beginning and underestimates the high and low prices towards the end of the trading window. This results in the trading strategy generating return equal to the open and close price each day in the beginning and slightly better returns towards the end.
Key Learnings from this model:
Next Steps:


final class JMockExpectations extends jmock.Expectations
Subclass of org.jmock.Expectations
that provides withArg
alternatives to the with
methods defined in its superclass.
JMockCycle
's expecting
method of passes an instance of this class
to the function passed into expectations
. Because JMockExpectations
extends org.jmock.Expectations
, all of the Expectations
methods are
available to be invoked on instances of this class, in addition to
several overloaded withArg
methods defined in this class. These withArg
methods simply
invoke corresponding with
methods on this
. Because with
is
a keyword in Scala, to invoke these directly you must surround them in back ticks, like this:
oneOf (mockCollaborator).documentAdded(`with`("Document"))
By importing the members of the JMockExpectations
object passed to
a JMockCycle
's executing
method, you can
instead call withArg
with no back ticks needed:
oneOf (mockCollaborator).documentAdded(withArg("Document"))
- Source
- JMockExpectations.scala
- Alphabetic
- By Inheritance
- JMockExpectations
- Expectations
- ActionClause
- ArgumentConstraintPhrases
- CardinalityClause
- ExpectationBuilder
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new JMockExpectations()
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
allowing[T](arg0: T): T
- Definition Classes
- Expectations → CardinalityClause
-
def
allowing(arg0: Matcher[_]): MethodClause
- Definition Classes
- Expectations → CardinalityClause
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
atLeast(arg0: Int): ReceiverClause
- Definition Classes
- Expectations → CardinalityClause
-
def
atMost(arg0: Int): ReceiverClause
- Definition Classes
- Expectations → CardinalityClause
-
def
between(arg0: Int, arg1: Int): ReceiverClause
- Definition Classes
- Expectations → CardinalityClause
-
def
buildExpectations(arg0: Action, arg1: ExpectationCollector): Unit
- Definition Classes
- Expectations → ExpectationBuilder
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
currentBuilder(): InvocationExpectationBuilder
- Attributes
- protected[org.jmock]
- Definition Classes
- Expectations
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
exactly(arg0: Int): ReceiverClause
- Definition Classes
- Expectations → CardinalityClause
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
def
ignoring(arg0: Matcher[_]): MethodClause
- Definition Classes
- Expectations → CardinalityClause
-
def
ignoring[T](arg0: T): T
- Definition Classes
- Expectations → CardinalityClause
-
def
inSequence(arg0: Sequence): Unit
- Definition Classes
- Expectations
-
def
inSequences(arg0: <repeated...>[Sequence]): Unit
- Definition Classes
- Expectations
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
never[T](arg0: T): T
- Definition Classes
- Expectations → CardinalityClause
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
def
one[T](arg0: T): T
- Definition Classes
- Expectations → CardinalityClause
-
def
oneOf[T](arg0: T): T
- Definition Classes
- Expectations
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
then(arg0: State): Unit
- Definition Classes
- Expectations
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
when(arg0: StatePredicate): Unit
- Definition Classes
- Expectations
-
def
will(arg0: Action): Unit
- Definition Classes
- Expectations → ActionClause
-
def
with[T](arg0: T): T
- Definition Classes
- Expectations
-
def
with(arg0: Double): Double
- Definition Classes
- Expectations
-
def
with(arg0: Float): Float
- Definition Classes
- Expectations
-
def
with(arg0: Long): Long
- Definition Classes
- Expectations
-
def
with(arg0: Int): Int
- Definition Classes
- Expectations
-
def
with(arg0: Char): Char
- Definition Classes
- Expectations
-
def
with(arg0: Short): Short
- Definition Classes
- Expectations
-
def
with(arg0: Byte): Byte
- Definition Classes
- Expectations
-
def
with(arg0: Boolean): Boolean
- Definition Classes
- Expectations
-
def
with(arg0: Matcher[Double]): Double
- Definition Classes
- Expectations → ArgumentConstraintPhrases
-
def
with(arg0: Matcher[Float]): Float
- Definition Classes
- Expectations → ArgumentConstraintPhrases
-
def
with(arg0: Matcher[Long]): Long
- Definition Classes
- Expectations → ArgumentConstraintPhrases
-
def
with(arg0: Matcher[Integer]): Int
- Definition Classes
- Expectations → ArgumentConstraintPhrases
-
def
with(arg0: Matcher[Character]): Char
- Definition Classes
- Expectations
-
def
with(arg0: Matcher[Short]): Short
- Definition Classes
- Expectations → ArgumentConstraintPhrases
-
def
with(arg0: Matcher[Byte]): Byte
- Definition Classes
- Expectations → ArgumentConstraintPhrases
-
def
with(arg0: Matcher[Boolean]): Boolean
- Definition Classes
- Expectations → ArgumentConstraintPhrases
-
def
with[T](arg0: Matcher[T]): T
- Definition Classes
- Expectations → ArgumentConstraintPhrases
-
def
withArg(matcher: Matcher[Char]): Char
Invokes
with
on this instance, passing in the passed matcher.Invokes
with
on this instance, passing in the passed matcher. -
def
withArg(matcher: Matcher[Double]): Double
Invokes
with
on this instance, passing in the passed matcher.Invokes
with
on this instance, passing in the passed matcher. -
def
withArg(matcher: Matcher[Float]): Float
Invokes
with
on this instance, passing in the passed matcher.Invokes
with
on this instance, passing in the passed matcher. -
def
withArg(matcher: Matcher[Boolean]): Boolean
Invokes
with
on this instance, passing in the passed matcher.Invokes
with
on this instance, passing in the passed matcher. -
def
withArg(matcher: Matcher[Long]): Long
Invokes
with
on this instance, passing in the passed matcher.Invokes
with
on this instance, passing in the passed matcher. -
def
withArg(matcher: Matcher[Byte]): Byte
Invokes
with
on this instance, passing in the passed matcher.Invokes
with
on this instance, passing in the passed matcher. -
def
withArg(matcher: Matcher[Short]): Short
Invokes
with
on this instance, passing in the passed matcher.Invokes
with
on this instance, passing in the passed matcher. -
def
withArg(matcher: Matcher[Int]): Int
Invokes
with
on this instance, passing in the passed matcher.Invokes
with
on this instance, passing in the passed matcher. -
def
withArg[T](matcher: Matcher[T]): T
Invokes
with
on this instance, passing in the passed matcher.Invokes
with
on this instance, passing in the passed matcher. -
def
withArg(value: Char): Char
Invokes
with
on this instance, passing in the passed value.Invokes
with
on this instance, passing in the passed value. -
def
withArg(value: Double): Double
Invokes
with
on this instance, passing in the passed value.Invokes
with
on this instance, passing in the passed value. -
def
withArg(value: Float): Float
Invokes
with
on this instance, passing in the passed value.Invokes
with
on this instance, passing in the passed value. -
def
withArg(value: Boolean): Boolean
Invokes
with
on this instance, passing in the passed value.Invokes
with
on this instance, passing in the passed value. -
def
withArg(value: Long): Long
Invokes
with
on this instance, passing in the passed value.Invokes
with
on this instance, passing in the passed value. -
def
withArg(value: Byte): Byte
Invokes
with
on this instance, passing in the passed value.Invokes
with
on this instance, passing in the passed value. -
def
withArg(value: Short): Short
Invokes
with
on this instance, passing in the passed value.Invokes
with
on this instance, passing in the passed value. -
def
withArg(value: Int): Int
Invokes
with
on this instance, passing in the passed value.Invokes
with
on this instance, passing in the passed value. -
def
withArg[T](value: T): T
Invokes
with
on this instance, passing in the passed value.Invokes
with
on this instance, passing in the passed value.


Overview: Vectors 向量
Unity uses the Vector3 class throughout to represent all 3D vectors. The individual components of a 3D vector can be accessed through its x, y and z member variables.
Note: This only works on JavaScript and Boo. In C# you will have to create a new instance of a Vector and assign it. var aPosition : Vector3;
Unity使用 Vector3 类来表现所有的3D向量.我们可以通过他的x,y和z成员变量获得3D向量的组件.
var aPosition : Vector3 ;
aPosition.x = 1;
aPosition.y = 1;
aPosition.z = 1;
You can also use the Vector3 constructor function to initialise all components at once.
你也能使用 Vector3 构造函数初始化所有的组件.
using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
public Vector3 aPosition = new Vector3(1, 1, 1);
}
var aPosition = Vector3(1, 1, 1);
Vector3 also defines some common values as constants.
Vector3 也定义了一些固定的常用值.
using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
public Vector3 direction = Vector3.up;
}
var direction = Vector3.up ;
// 等同于 Vector3(0, 1, 0)
Operations on single vectors are accessed the following way:
规范化向量可以使用下面的方法:
using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
public void Awake() {
SomeVector.Normalize();
}
}
SomeVector.Normalize();
And operations using multiple vectors are done using Vector3 class functions:
使用 Vector3 类函数计算多个向量的情况:
using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
public Vector3 oneVector = new Vector3(0, 0, 0);
public Vector3 otherVector = new Vector3(1, 1, 1);
public float theDistance = Vector3.Distance(oneVector, otherVector);
}
(Note that you have to write Vector3. in front of the function name to tell Javascript where to find the function. This applies to all class functions.)
You can also use the common math operators to manipulate vectors: combined = vector1 + vector2;
See the documentation on the Vector3 class for the full list of operations and properties available.
(注意你必须在函数名之前写上Vector3.以便Javascript能找到那个函数.这个规则也应用于所有的类函数.)
你也能使用常见的数学运算操作向量:combined = vector1 + vector2;
查看文档 Vector3 类可以获得更过相关信息.


WebSiteName
Home
Add Program
Advertise
RCB
Contact
Sign Up
Login
Perfestional
Email:
Birthday:
Gender:
Male
Flame
Other
Address:
Description:
Save
Change password
New password:
Current password:
Save


{{content-for "head"}} {{content-for "head-footer"}}
This application requires JavaScript.
Here are instructions how to enable JavaScript in your web browser.
Loading...


Nubulsa Expo
问题描述 :
As you know, the Expo garden is made up of many museums of different countries. In the Expo garden, there are a lot of bi-directional roads connecting those museums, and all museums are directly or indirectly connected with others. Each road has a tourist capacity which means the maximum number of people who can pass the road per second.
Because Nubulsa is not a rich country and the ticket checking machine is very expensive, the government decides that there must be only one entrance and one exit. The president has already chosen a museum as the entrance of the whole Expo garden, and it’s the Expo chief directory Wuzula’s job to choose a museum as the exit.
Wuzula has been to the Shanghai Expo, and he was frightened by the tremendous “people mountain people sea” there. He wants to control the number of people in his Expo garden. So Wuzula wants to find a suitable museum as the exit so that the “max tourists flow” of the Expo garden is the minimum. If the “max tourist flow” is W, it means that when the Expo garden comes to “stable status”, the number of tourists who enter the entrance per second is at most W. When the Expo garden is in “stable status”, it means that the number of people in the Expo garden remains unchanged.
Because there are only some posters in every museum, so Wuzula assume that all tourists just keep walking and even when they come to a museum, they just walk through, never stay.
输入:
For each test case:
The first line contains three integers N, M and S, representing the number of the museums, the number of roads and the No. of the museum which is chosen as the entrance (all museums are numbered from 1 to N). For example, 5 5 1 means that there are 5 museums and 5 roads connecting them, and the No. 1 museum is the entrance.
The next M lines describe the roads. Each line contains three integers X, Y and K, representing the road connects museum X with museum Y directly and its tourist capacity is K.
Please note:
1<N<=300, 0<M<=50000, 0<S,X,Y<=N, 0<K<=1000000
输出:
For each test case:
The first line contains three integers N, M and S, representing the number of the museums, the number of roads and the No. of the museum which is chosen as the entrance (all museums are numbered from 1 to N). For example, 5 5 1 means that there are 5 museums and 5 roads connecting them, and the No. 1 museum is the entrance.
The next M lines describe the roads. Each line contains three integers X, Y and K, representing the road connects museum X with museum Y directly and its tourist capacity is K.
Please note:
1<N<=300, 0<M<=50000, 0<S,X,Y<=N, 0<K<=1000000
样例输入:
5 5 1 1 2 5 2 4 6 1 3 7 3 4 3 5 1 10 0 0 0
样例输出:
8
#include <algorithm> #include <iostream> #include <cstring> #include <cstdio> #define INF 305 #define inf 0x0f0f0f0f using namespace std; int cap[INF][INF],Dfn[INF],Wage[INF]; void Pre_gragh(int i,int j,int c) { cap[i][j]+=c,cap[j][i]+=c; } int Stoer_Wagner(int n) { int mincut=inf,i,j,now,t; for (i=1;i<=n;i++) Dfn[i]=i; for (;n>1;n--) { memset(Wage,0,sizeof(Wage)); for (i=1;i<=n;i++,swap(Dfn[i],Dfn[now])) for (now=j=i+1;j<=n;j++) if (t=Dfn[j],Wage[t]+=cap[Dfn[i]][t],Wage[Dfn[now]]<Wage[t]) now=j; mincut=min(mincut,Wage[Dfn[n]]); for (i=1;i<=n-1;i++) now=cap[Dfn[i]][Dfn[n]], cap[Dfn[i]][Dfn[n-1]]+=now, cap[Dfn[n-1]][Dfn[i]]+=now; } return mincut; } int main() { int n,m,k,i,x,y,z; while (scanf("%d%d%d",&n,&m,&k),n) { memset(cap,0,sizeof(cap)); for (i=1;i<=m;i++) scanf("%d%d%d",&x,&y,&z),Pre_gragh(x,y,z); printf("%d\n",Stoer_Wagner(n)); } return 0; }
不对吧 你算的an是前面说有的项的和
#!/usr/bin/env python def cou(n): arr = [1]
失误失误，转载错了。已经改正，抱歉。
什么破题，题意好难懂啊
受益匪浅！！
赞！！~~大赞！！~
这道题目的核心一句话是：取还是不取。
如果当前取，则index+1作为参数。如果当前不取，则任用index作为参数。
博主的C++功底真是好
第一句可以忽略不计了吧。从第二句开始分析，说明这个花色下的所有牌都会在其它里面出现，那么还剩下♠和♦。第三句，可以排除2和7，因为在两种花色里有。现在是第四句，因为♠还剩下多个，只有是♦B才能知道答案。
因为是要把从字符串s的start位到当前位在hash中重置，修改提交后能accept，但是不修改居然也能accept
多谢提醒。代码又编辑了一下
漂亮。佩服。
P.S. unsigned 应该去掉。换行符是n 不是/n
还可以稍微优化一下，
int main() {
int m,n,ai,aj,bi,bj,ak,bk;
while (scanf("%d%d",&m,&n)!=EOF) {
ai = sqrt(m-1);
bi = sqrt(n-1);
aj = (m-ai*ai-1)>>1;
bj = (n-bi*bi-1)>>1;
ak = ((ai+1)*(ai+1)-m)>>1;
bk = ((bi+1)*(bi+1)-n)>>1;
printf("%dn",abs(ai-bi)+abs(aj-bj)+abs(ak-bk));
}
}
递归还真是一门学问，学习了
a是根先忽略掉，递归子树。剩下前缀bejkcfghid和后缀jkebfghicd，分拆的原则的是每个子树前缀和后缀的节点个数是一样的，根节点出现在前缀的第一个，后缀的最后一个。根节点b出现后缀的第四个位置，则第一部分为四个节点，前缀bejk，后缀jkeb，剩下的c出现在后缀的倒数第2个，就划分为cfghi和 fghic，第3部分就为c、c


Platforms Selected:
All
Countries Selected:
All
Platform
Drifting Buoys
Ice Buoys
Hurricane Drifters
Moored Buoys
Climate Reference Stations
Tropical Moored Buoys
Tsunami (DART) Buoys
Weather Buoys
Shore and Bottom Stations
CMAN Stations
Argo Profiling Floats
XBTs
All Ships
VOS Ships
VOSclim Ships
Underway Carbon Ships
Tide Gauge Stations
Gliders
Pinnipeds
Unknown Platforms
Country
Australia
Brazil
Canada
China
European Union
France
Germany
India
Ireland
Japan
South Korea
Spain
Netherlands
New Zealand
Norway
South Africa
Ukraine
United Kingdom
United States
Third
Nam dui erat, auctor a, dignissim quis.


[% page.import({ title => 'Testing your code', section => 'testing', description => 'How to test your Perl code', }); %]
Ian Langworth, author of Perl Testing: A Developer's Notebook has put together a tremendous Perl testing quick reference card.
perl.com has published a number of articles on specific testing techniques:
The CPAN has a wide variety of modules to help with your automated testing. Here's a summary of what's available.
Here's a handy summary of guidelines for writing effective tests, compiled from lessons learned when improving the tests for DBI.
Automated testing is a key part of software development, especially in environments that have embraced extreme programming. Perl's Test::Harness framework, along with Test::Simple and Test::More, allow flexible testing of all parts of your development projects.
A starter list of resources:


Jupyter Widget¶
After installing and enabling the Jupyter widget, you can use the library within a notebook in the following way:
import algorithmx
# Create a Jupyter canvas interface
canvas = algorithmx.jupyter_canvas()
# Set the size of the canvas
canvas.size((300, 200))
# Use the library normally, for example:
canvas.nodes([1, 2]).add()
canvas.edge((1, 2)).add()
# Display the canvas
display(canvas)
Note that you need to hold down the ctrl
/cmd
key to zoom in. If you are creating an algorithm simulation, you
can also enable start/stop/restart buttons:
canvas = algorithmx.jupyter_canvas(buttons=True)
-
algorithmx.
jupyter_canvas
(buttons: bool = False) → algorithmx.jupyter.JupyterCanvas.JupyterCanvas[source]¶ Creates a new
Canvas
which will dispatch and receive events through a Jupyter widget, and which can be displayed using the IPythondisplay
function.By default, the canvas size is (400, 250), and requires the
ctrl
/cmd
to be held down while zooming.


{% extends "index.html" %} {% block body %}
ESSA identifies the residues whose perturbation upon ligand binding would cause a significant change in the frequency dispersion of global modes (Kaynak et al., 2020). These residues are called essential residues, as they play a dominant role in controlling the proteins’ essential dynamics. Perturbations are serially made on each residue via insertion of new nodes located at the heavy atoms of their sidechains for mimicking the crowding/constraints in their local environment imparted by ligand binding. The mean shift (usually increase) induced in the frequency of the softest modes is used as a measure of essentiality. Essential residues may include those participating in allosteric and orthosteric sites, as well as those modulating global hinge bending movements.
You can use ESSA to
Reference
Kaynak B.T., Bahar I., Doruker P.
Essential site scanning analysis: A new approach for detecting sites that modulate the dispersion of protein global motions
Comput Struct Biotechnol J 2020 18:1577–1586.
Le Guilloux V., Schmidtke P., Tuffery P.
Fpocket: An open source platform for ligand pocket detection
BMC Bioinformatics 2009 16:168.


You know me now!
Well, thanks for playing these guessing games to get to know me. As I said, we now know a little about each other. I know your name, and you here is what you found out about me:
- I went to the North Pole while I was in the Navy
- I have lived in 11 states
- Illinois (2 different times)
- Massachusetts
- Texas
- Missouri
- Florida
- Conneticut (3 different times)
- Hawaii
- Mississppi
- Louisiana
- Washington (2 different times)
- California
- I have lived in 4 countries
- United States
- Australia
- Brazil
- Mexico
I'd also like to share my Top 10 favorite cities with you.
- Seattle, WA
- Rio de Janeiro
- Perth, W. Australia
- New Orleans, LA
- Vancouver, B.C.
- Singapore
- New York City
- Tokyo, Japan
- Rome, Italy
- Ithaca, NY
I promissed some photos of my trip to the North Pole.
Since it was an unclassified mission, I can share these with you.


class: center, middle .title[Lecture 4: Time Series Analyses] .author[Shane Elipot] .institution[The Rosenstiel School of Marine and Atmospheric Science, University of Miami] .date[] .note[] .footnote[Created with [{Remark.js}](http://remarkjs.com/) using [{Markdown}](https://daringfireball.net/projects/markdown/) + [{MathJax}](https://www.mathjax.org/)] --- name: foreword class: left, .toc[[✧](#toc)] # Foreword This lecture is heavily based on a longer course by Jonathan M. Lilly freely available for online viewing or download at [http://jmlilly.net/course.html](http://jmlilly.net/course.html) --- name: references class: left, .toc[[✧](#toc)] ## References [1] Bendat, J. S., & Piersol, A. G. (2011). *Random data: analysis and measurement procedures* (Vol. 729). John Wiley & Sons. [2] Percival, D. B. and Walden, A. T. (1993). *Spectral Analysis for Physical Applications*. Cambridge University Press [3] Jenkins, G.M. and Watts, D. G. (1968). *Spectral Analysis and its Applications*. Holden Days --- name: toc class: left, .toc[[✧](#toc)] # Outline 1. [The time domain](#timedomain) 2. [Stationarity, non-stationarity, and trends](#stationarity) 3. [Fourier Spectral analysis](#spectral) 4. [Bivariate time series](#bivariate) 4. [Filtering and other topics](#filtering) 4. [Multitaper revisited](#revisited) --- name: timedomain class: center, middle, .toc[[✧](#toc)] # 1. The time domain --- class: left, .toc[[✧](#toc)] # The Sample Interval We have a sequence of `$N$` observations `$$x_n, \quad\quad n=0,1,2,\ldots N-1$$` which coincide with times `$$t_n, \quad\quad n=0,1,2,\ldots N-1.$$` The sequence `$x_n$` is called a *discrete time series*. It is assumed that the *sample interval*, `$\Delta_t$`, is constant `$$t_n=n\Delta_t$$` with the time at `$n=0$` defined to be `$0$`. The *duration* is `$T=N\Delta_t$`. If the sample interval in your data is not uniform, the first processing step is to interpolate it to be so. --- class: left, .toc[[✧](#toc)] # The Underlying Process A critical assumption is that there exists some “process” `$x(t)$` that our data sequence `$x_n$` is a *sample of*: `\[x_n=x(n\Delta_t), \quad\quad n=0,1,2,\ldots N-1.\]` Unlike `$x_n$`, `$x(t)$` is believed to exist for *all times*. (i) The process `$x(t)$` exists in *continuous time*, while `$x_n$` only exists at *discrete times*. (ii) The process `$x(t)$` exists for *all past and future* times, while `$x_n$` is only available over a certain time interval. It is the properties of `$x(t)$` that we are trying to estimate, *based on* the available sample `$x_n$`. --- class: left, .toc[[✧](#toc)] # Measurement Noise In reality, the measurement device and/or data processing probably introduces some artifical variability, termed *noise*. It is more realistic to consider that the observations `$x_n$` contain samples of the process of interest, `$y(t)$`, *plus* some noise `$\epsilon_n$`: `\[x_n = y(n\Delta_t)+ \epsilon_n, \quad\quad n=0,1,2,\ldots N-1.\]` This is an example of the *unobserved components model*. This means that we *believe* that the data is composed of *different components*, but we cannot observe these components individually. The process `$y(t)$` is potentially obscured or degraded by the limitations of data collection in three ways: (i) finite sample interval, (ii) finite duration, (iii) noise. Because of this, the time series is an *imperfect* representation of the real-world processes we are trying to study. --- class: left, .toc[[✧](#toc)] # Time versus Frequency There are two complementary points of view regarding the time series `$x_n$`. The first regards `$x_n$` as being built up as a sequence of discrete values `$x_0,x_2,\dots x_{N-1}$`. This is the domain of *statistics*: the mean, variance, histogram, etc. When we look at data statistics, generally, the order in which the values are observed *doesn't matter*. The second point of view regards `$x_n$` as being built up of sinusoids: purely periodic functions spanning the whole duration of the data. This is the domain of *Fourier spectral analysis*. In between these two extremes is wavelet analysis which is not covered here, see the Oslo lectures. --- class: left, .toc[[✧](#toc)] # Time-Domain Statistics Time domain statistics consist of the parameters we have considered earlier during the week: sample mean, sample variance, skewness, kurtosis, and higher moments. The term *sample* is being used to distinguish these quantities calculated from the data sample from the population, or true, statistics of the assumed underlying process `$x(t)$`. That's why we use `$\widehat{(\cdot)}$` --- name: stationarity class: center, middle, , .toc[[✧](#toc)] # 2. Stationarity vs non-stationarity, trends --- class: center, .toc[[✧](#toc)] #First Example
--- class: center, .toc[[✧](#toc)] #First Example
--- class: center, .toc[[✧](#toc)] #First Example
--- class: left, .toc[[✧](#toc)] # Observable Features 1. The data consists of two time series that are similar in character. 1. Both time series present a superposition of scales and a high degree of roughness. 1. The data seems to consist of different time periods with distinct statistical characteristics—the data is *nonstationary*. 1. Zooming in to one particular period show regular oscillations of roughly uniform amplitude and frequency. 1. The phasing of these show a circular polarization orbited in a counterclockwise direction. 1. The zoomed-in plot shows a fair amount of what appears to be measurement noise superimposed on the oscillatory signal. -- This is a record of velocities of a single surface drifter at 6-hour intervals. All Surface drifter data are freely available from the Data Assembly Center of the Global Drifter Program [{www.aoml.noaa.gov/phod/dac/}](http://www.aoml.noaa.gov/phod/dac/index.php). --- class: center, .toc[[✧](#toc)] # Second Example We have already encountered this time series ...
--- class: center, .toc[[✧](#toc)] # Second Example
--- class: left, .toc[[✧](#toc)] # Observable Features 1. The data exhibit a very strong positive trend, roughly linear with time. Thus, this time series does not present a **mean statistics** that represents a "typical" value. 1. On top of the trend there seems to be a sinusoid-like oscillation that does not appear to change with time. 1. The zoomed-in plot shows noise superimposed on the sinusoidal and trend processes. -- This is a record of daily atmospheric CO$_2$ measured at Mauna Loa in Hawaii at an altitude of 3400 m. Data from Dr. Pieter Tans, NOAA/ESRL ([{www.esrl.noaa.gov/gmd/ccgg/trends/}](http://www.esrl.noaa.gov/gmd/ccgg/trends/)) and Dr. Ralph Keeling, Scripps Institution of Oceanography ([{scrippsco2.ucsd.edu}](http://scrippsco2.ucsd.edu/)). We will investigate again this time series during the practical session this afternoon, this time using a spectral analysis approach. --- class: left, .toc[[✧](#toc)] # Non-stationarity The sample statistics may be changing with time because the underlying process (that is its statistics) is changing with time. The process is said to be “non-stationary”. Sometimes we need to re-think our model for the underlying process. As we say in Lecture 3, we can hypothesize that the process `$x(t)$` is the sum of an unknown process $y(t)$, plus a linear trend $a$, plus noise: `$$x(t) = y(t) + a t + \epsilon(t),$$` -- or maybe the trend is better described as being quadratic with time because of an acceleration: `$$x(t) = y(t) + b t^2 + a t + \epsilon(t).$$` -- The goal is then to estimate the unknowns $a,b$, which consists of methods of analyses generally called “parametric”. It is a bit like analyzing the data in terms of its statistics (with no prior expectations) or assuming a form for the data. --- name: spectral class: center, middle, .toc[[✧](#toc)] # 3. Fourier Spectral Analysis --- class: center, .toc[[✧](#toc)] # Complex Fourier Series It is possible to represent a discrete time series `$x_n$` as a sum of complex exponentials, a complex Fourier series: `\[ x_n = \frac{1}{N \Delta_t}\sum_{m=0}^{N-1} X_m e^{i2\pi m n/N}, \quad\quad\quad n=0,1,\ldots N-1 \]`
We leave out for now how to obtain the complex coefficients `$X_m$` ... --- class: left, .toc[[✧](#toc)] # About Frequency You will typically find two frequency notations: `\[ \cos(2 \pi f t)\quad\quad \text{or} \quad\quad \cos(\omega t) \]` `$f$` is called the *cyclic* frequency. Its units are cycles/time. Example: Hz = cycles/sec. `$\omega = 2 \pi f$` is called the *radian* or *angular* frequency. Its units are rad/time. The associated *period* of oscillation is `$P=1/f=2\pi/\omega$`. As `$t$` goes from `$0$` to `$1/f = 2\pi/\omega = P$`, `$2 \pi f t$` goes from `$0$` to `$2\pi$` and `$\omega t$` goes from `$0$` to `$2\pi$`. A very common error in Fourier analysis is mixing up cyclic and radian frequencies! Note: neither “cycles” nor “radians” actually have any units, thus both `$f$` and `$\omega$` have units of 1/time. However, specifying for example 'cycles per day' or 'radians per day' helps to avoid confusion. --- class: center, .toc[[✧](#toc)] #Review: Sinusoids Cosine function (blue) and sine function (orange)
--- class: center, .toc[[✧](#toc)] # Complex Exponentials, 2D Now consider a plot `$\cos(t)$` vs. `$\sin(t)$`. That's the same as `$ \cos(t) + i \sin( t) = e^{i t}$`.
--- class: center, .toc[[✧](#toc)] # Complex Exponentials, 3D This is better seen in 3D as a *spiral* as time increases. `\[\cos(t) + i \sin( t) = e^{i t} \]`
--- class: left, .toc[[✧](#toc)] # The complex Fourier series The discrete time series `$x_n$` can written as a sum of complex exponentials: `\[ x_n = \frac{1}{N\Delta_t}\sum_{m=0}^{N-1} X_m e^{i2\pi m n/N} = \frac{1}{N\Delta_t}\sum_{m=0}^{N-1} X_m e^{i2\pi n \Delta_t \cdot (m/N \Delta_t)}, \quad n=0,1,\ldots N-1 \]` -- The `$m$`th term behaves as `$ e^{i2\pi f_m n \Delta_t} =\cos(2\pi f_m n \Delta_t) +i \sin(2\pi f_m n \Delta_t) $`, where `$f_m\equiv m/N \Delta_t$`. Note that in the literature, `$\Delta_t$` is often set to one, and thus omitted, leading to a lot of confusion (including for me!). The quantity `$f_m\equiv m/N \Delta_t$` is called the `$m$`th *Fourier frequency*. The *period* associated with `$f_m$` is `$1/f_m=\Delta_t N/m$`. Thus `$m$` tells us the *number of oscillations* contained in the length `$N \Delta_t$` time series. --- class: center, .toc[[✧](#toc)] # Continuous Time `$\cos(2\pi f_m t)$` and `$\sin(2\pi f_m t)$` `$f_m=0,$` `$1/100,$` `$2/100,$` `$3/100\quad\quad$` `$t=[0\ldots 100]$`
--- class: center, .toc[[✧](#toc)] # Discrete Time `$\cos(2\pi f_m n \Delta_t)$` and `$\sin(2\pi f_m n \Delta_t)$` `$f_m=0,$` `$1/100,$` `$2/100,$` `$3/100\quad$` `$n=0,1,2,\dots 99\quad$` `$\Delta_t = 1$`
--- class: center, .toc[[✧](#toc)] # The Nyquist Frequency The single most important frequency is the *highest resolvable* frequency, the *Nyquist frequency*. `$f^\mathcal{N} \equiv \frac{1}{2\Delta_t} = \frac{1}{2}\cdot\frac{1}{\Delta_t}\quad\quad \omega^\mathcal{N} \equiv \frac{1}{2}\cdot\frac{2\pi}{\Delta_t}=\frac{\pi}{\Delta_t}$`
The highest resolvable frequency is *half* the *sampling rate* or *one cycle per two sampling intervals*. `$e^{i2\pi f^{\mathcal{N}} n \Delta_t}=e^{i2\pi \cdot 1/(2\Delta_t) \cdot n\Delta_t}=e^{i\pi n} = (-1)^n = 1,-1,1,-1,\dots $` Note that there is no “sine” component at Nyquist in the Fourier series! --- class: center, .toc[[✧](#toc)] # The Rayleigh Frequency The second most important frequency is the *lowest resolvable* frequency, the *Rayleigh frequency*. `$f^\mathcal{R} \equiv \frac{1}{N\Delta_t}\quad\quad \omega^\mathcal{R} \equiv \frac{2\pi}{N\Delta_t}$`
The lowest resolvable frequency is one cycle over the *entire record*. Here the sample interval `$\Delta_t=1$` and the number of points is `$N=10$`. --- class: left, .toc[[✧](#toc)] # Importance of Rayleigh The Rayleigh frequency `$f^\mathcal{R}$` is important because it gives the *spacing between* the Fourier frequencies: `$f_0=0$`, `$f_1=\frac{1}{N\Delta_t}$`, `$f_2=\frac{2}{N\Delta_t},\ldots$` `$\quad\quad f_n=n\,f^\mathcal{R},\quad\quad f^\mathcal{R}=\frac{1}{N\Delta_t}$` Thus, it controls the *frequency-domain resolution*. If you want to distiguish between two closely spaced peaks, you need the dataset *duration* to be sufficiently *large* so that the Rayleigh frequency is sufficiently *small*. -- As an example, the two principal semi-diurnal tidal “species” have period of 12 h (M`$_2$`) and 12.4206012 h (S`$_2$`). The minimum record length to distinguish the two frequencies is thus `\[N \Delta_t = \frac{1}{f^\mathcal{R}} = \frac{1}{f^{S_2} - f^{M_2}} =\frac{1}{\frac{1}{12} - \frac{1}{12.4206012}} = 354.36 \text{ hours}.\]` --- class: left, .toc[[✧](#toc)] # Rayleigh and Nyquist frequencies The ratio of the Rayleigh to Nyquist frequencies tells you how many *different frequencies* you can resolve. `\[\frac{f^\mathcal{N}}{f^\mathcal{R}}=\frac{N\Delta_t}{2\Delta_t}=\frac{N}{2}\]` So why do we have `$N$` frequencies in the sum for the complex Fourier series? `\[ x_n = \frac{1}{N \Delta_t}\sum_{m=0}^{N-1} X_m e^{i2\pi m n/N}\]` --- class: left, .toc[[✧](#toc)] #The Fourier Frequencies The first few Fourier frequencies `$f_m=m/(N\Delta_t)$` are: `\[f_0=\frac{0}{N\Delta_t},\quad f_1=\frac{1}{N\Delta_t}, \quad f_2=\frac{2}{N\Delta_t},\ldots\]` while the last few are `\[\ldots,f_{N-2}=\frac{N-2}{N\Delta_t}=\frac{1}{\Delta_t}-\frac{2}{N\Delta_t},\quad f_{N-1}=\frac{N-1}{N\Delta_t}=\frac{1}{\Delta_t}-\frac{1}{N\Delta_t}.\]` But notice that the last Fourier exponential term is `\[e^{i2\pi f_{N-1} n\Delta_t} = e^{i2\pi (N-1) n/N}=e^{i2\pi n}e^{-i2\pi n/N}=e^{-i2\pi n/N} = e^{-i2\pi f_1 n \Delta_t}\]` because `$e^{i2\pi n}=1$` for all integers `$n$`! Frequencies higher than the Nyquist cannot appear due to our sample rate. Therefore, these terms instead specify terms that have a frequency *less than* the Nyquist but that rotate in the *negative* direction. --- class: left, .toc[[✧](#toc)] #The Fourier Frequencies In the vicinity of `$m=N/2$`, for even `$N$`, we have `\[f_{N/2-1}=\frac{1}{2\Delta_t}-\frac{1}{N\Delta_t},\quad f_{N/2}=\frac{1}{2\Delta_t}, \quad f_{N/2+1}=\frac{1}{2\Delta_t}+\frac{1}{N\Delta_t},\ldots\]` but actually the first frequency higher than the Nyquist is the *highest negative frequency*: `\[f_{N/2-1}=\frac{1}{2\Delta_t}-\frac{1}{N\Delta_t},\quad f_{N/2}=\frac{1}{2\Delta_t}, \ldots \]` `\[f_{N/2+1} = -f_{N/2-1} =-\left(\frac{1}{2\Delta_t}-\frac{1}{N\Delta_t}\right),\ldots.\]` Thus the positive frequencies and negative frequencies are both increasing *toward the middle* of the Fourier transform array. For this reason Matlab provides
fftshift
, to shifts the zero frequency, *not* the Nyquist, to be in the middle of the array. --- class: left, .toc[[✧](#toc)] #One-Sided vs. Two-Sided There exists two strictly equivalent representations, *two-sided* and *one-sided*, of the discrete Fourier transform: `\begin{eqnarray} x_n&=&\frac{1}{N\Delta_t}\sum_{m=0}^{N-1} X_m e^{i2\pi m n/N},\\ x_n&=& \frac{1}{N\Delta_t}X_0 + \frac{2}{N\Delta_t}\sum_{m=1}^{N/2-1} A_m \cos\left(2\pi m n/N +\Phi_m\right) + X_{N/2} (-1)^n, \end{eqnarray}` where `$A_m$` and `$\Phi_m$` are an *amplitude* and *phase*, with `$X_m = A_m e^{i \Phi_m}$`. The two-sided representation is more compact mathematically. For real-valued `$x_n$`, the one-sided representation is more intuitive as it expresses `$x_n$` as a sum of *phase-shifted* cosinusoids. -- A price of the one-sided form is that even and odd `$N$` are somewhat different! The expression above is for even-valued `$N$`. --- class: left, .toc[[✧](#toc)] #The Forward DFT So? How do we know the values of the Fourier coefficients `$X_m$`? It can be shown that: `\[X_m = \Delta_t \sum_{n=0}^{N-1}x_n e^{-i2\pi m n/N}\]` This is called the *discrete Fourier transform* of `$x_n$`. The DFT *transforms* `$x_n$` from the time domain to the frequency domain. The DFT *defines* a sequence of `$N$` complex-valued numbers, `$X_m$`, for `$m=0,1,2,\ldots N-1$`, which are termed the *Fourier coefficients.* In Matlab, the discrete Fourier transform defined above is computed by
fft(x)
`$\times \Delta_t $`. --- class: left, .toc[[✧](#toc)] #The Inverse DFT In fact, `\[x_n \equiv \frac{1}{N\Delta_t}\sum_{m=0}^{N-1}X_m e^{i2\pi m n/N}\]` is called the *inverse discrete Fourier transform.* It expresses how `$x_n$` may be *constructed* using the Fourier coefficients multiplying complex exponentials—or, as we saw earlier, phase-shifted cosinusoids. --- class: left, .toc[[✧](#toc)] #The Spectrum **One of several definitions** of the *spectrum*, or *spectral density function*, at frequency `$f_m$`, is: `\[S(f_m) \equiv \lim_{N \rightarrow \infty} E\left\{ \frac{|X_m|^2}{N} \right\}.\]` `$E\{\cdot\}$` is called the *expectation*, it is a conceptual “average” over a statistical ensemble, and it cannot obtained in practice. -- Formally, the function `$S$` is defined for all frequencies `$f$`, not only `$f_m$`, but as `$N \rightarrow \infty$`, the Rayleigh frequency `$1/N\Delta_t$` becomes infinitesimally small, and all frequencies are obtained. -- However, `$N \rightarrow \infty$` is not achievable ... Therefore, one aspect of spectral analysis is to find an acceptable **estimate** of the true, unknown, spectrum `$S(f)$` of the process `$x(t)$`. --- class: left, .toc[[✧](#toc)] #The Parseval Theorem A very important theorem is *Parseval's theorem* which takes the following form for the discrete case: `\[\Delta_t \sum_{n=0}^{N-1} |x_n|^2 = \frac{1}{N\Delta_t} \sum_{m=0}^{N-1} |X_m|^2.\]` When `$\widehat{\mu}_x=0$`, this theorem shows that the total **variance** of `$x_n$` is recoverable from the sum of absolute Fourier coefficients squared. Which can be interpreted as saying that the spectrum gives you the distribution of the variance as a function of frequency. --- class: left, .toc[[✧](#toc)] #Spectral Estimates The simplest way to estimate the *spectrum* `$S(f)$` function of frequency `$f$` is to simply take the modulus squared of the Fourier transform, `\[\widehat{S}(f_m) = \widehat{S}_m\equiv \frac{1}{N}\left|X_m\right|^2,\quad\quad m=0, 1, 2, \ldots,(N-1).\]` This quantity is known as the *periodogram*. Note that the Matlab
fft(x)
command assumes `$\Delta_t = 1$` so you need to plot
abs(fft(x))
`$^2\times \Delta_t /N$`. As we shall see, the periodogram is *not* the spectrum! It is an *estimate* of the spectrum—and generally speaking, a very poor one. It is also said to be the *naive* spectral estimate, meaning it is the spectral estimate that you get if you don't know that there is something better. Please do not use the periodogram in your publications. --- class: left, .toc[[✧](#toc)] #The Multitaper Method An alternate spectral estimate called the *multitaper* method. Here is a quick sketch of this method. We form a set of `$K$` different sequences the same length as the data, that is, having `$N$` points in time. These sequences are chosen from a special family of functions that is closely related to familiar orthogonal functions, e.g. the Hermite functions. These `$K$` different sequences are denoted as `$\psi_n^{\{k\}}$` for `$k=1,2,\ldots K$.` For each of these sequence, we form a spectral estimate as `\[\widehat S_m^{\{k\}}\equiv \left|\Delta_t \sum_{n=0}^{N-1} \psi_n x_n\, e^{-i 2\pi m n/N}\right|^2,\quad\quad n=0, 1, 2, \ldots,(N-1).\]` which involves *multiplying* the data by the sequence `$\psi_n^{\{k\}}$` *before* taking the Fourier transform. --- class: left, .toc[[✧](#toc)] #The Multitaper Method The action of multiplying the data by some sequence before Fourier transforming it, as in `\[\widehat S_m^{\{k\}}\equiv \left|\Delta_t \sum_{n=0}^{N-1} \psi_n x_n\, e^{-i 2\pi m n/N}\right|^2,\quad\quad n=0, 1, 2, \ldots,(N-1)\]` is called *tapering*. The goal is to reduce the **bias** (systematic error) of the spectral estimate. These `$K$` different individual estimates (aka *eigenspectra*), are combined into one *average* spectral estimate, in order to reduce the **variance** (random error) of the estimate `\[\widehat S_m^{\psi}\equiv \frac{1}{K}\sum_{k=1}^K\widehat S_m^{\{k\}}.\]` The multitaper method therefore involves two steps: (i) *tapering* the data, and (ii) *averaging* over multiple individual spectral estimates. --- class:center, .toc[[✧](#toc)] #The Taper Functions
`Here $K=5$` *Slepian* tapers are shown. These are orthogonal functions that become more oscillatory for increasing `$K$.` --- class: left, .toc[[✧](#toc)] #The Multitaper Method The multitaper method controls the degrees of spectral *smoothing* and *averaging* through changing the properties of the tapers. The multitaper method is generally the favorite spectral analysis method among those researchers who have thought the most about spectral analysis. It is recommended because **(i)** it avoids the deficiencies of the periodogram, **(ii)** it has, in a certain sense, provable optimal properties, **(iii)** it is very easy to implement and adjust, **(iv)** it allows an estimate of the spectrum for the period equal to the length of your time series (no need to divide up your time series as for the Welch's method!). See .cite[Thomson (1982)], .cite[Park et al. (1987)], and .cite[Percival and Walden, *Spectral Analysis for Physical Applications*]. --- class: left, .toc[[✧](#toc)] #Example Agulhas current boundary transport from .cite[ Beal, L. M. and S. Elipot, Broadening not strengthening of the Agulhas Current since the early 1990s, Nature, 540, 570573, [doi:10.1038/nature19853](http://dx.doi.org/10.1038/nature19853)]
--- class: left, .toc[[✧](#toc)] #Example: periodogram Linear plot
--- class: left, .toc[[✧](#toc)] #Example: periodogram Log-log plot
--- class: left, .toc[[✧](#toc)] #Example: multitaper Effect of first taper
--- class: left, .toc[[✧](#toc)] #Example: multitaper Second taper
--- class: left, .toc[[✧](#toc)] #Example: multitaper Third taper
--- class: left, .toc[[✧](#toc)] #Example: multitaper Fourth taper
--- class: left, .toc[[✧](#toc)] #Example: multitaper Fifth taper
--- class: left, .toc[[✧](#toc)] #Example: multitaper Fifth taper
--- class: left, .toc[[✧](#toc)] #Example: multitaper Eigen spectra (colors) and multitaper estimate (black)
--- class: left, .toc[[✧](#toc)] #Example: period. vs mt Periodogram (gray) vs multitaper (black)
--- class: left, .toc[[✧](#toc)] ## Uncertainty of the spectrum It can be shown (not here) that the estimate of the spectrum with `$K$` tapers `$$ \widehat{S}(\omega) \sim S(\omega)\frac{\chi^2_{2K}}{2K} $$` -- As such, a `$(1-\alpha)100\%$` CI is `$$ \left[ \frac{2 K \widehat{S}(\omega)}{\chi^2_{2K;\alpha/2}} < S(\omega) < \frac{2 K \widehat{S}}{\chi^2_{2K;1-\alpha/2}}\right] $$` -- This means that you **multiply** `$\widehat{S(\omega)}$` by `${2 K}/{\chi^2_{2K;\alpha/2}}$` to get the lower bound and similarly for the upper bound.  Bivariate time series --- class: left, .toc[[✧] #Vector and complex notations What if your process of interest is composed of two time series, let's say `$x(t)$` and `$y(t)$`? As in the vector components of ocean currents or atmospheric winds: `\begin{eqnarray} \mathbf{z}(t) = \left[ \begin{matrix} x(t) \\ y(t) \end{matrix}\right] \end{eqnarray}` Often, a *bivariate* time series is conveniently written as a complex-valued time series: `\[ z(t) = x(t) + i y(t) = |z(t)| e^{i \arg{(z)}},\]` where `$i = \sqrt{-1}$` and `$\arg{(z)}$` is the *complex argument* (or polar angle) of `$z$` in the interval `$[-\pi,+\pi]$`. --- class: left, .toc[[✧](#toc)] #The Mean of Bivariate Data The sample mean of the vector time series `$\mathbf{z}_n$` is also a vector, `\[\mathbf{\mu}_\mathbf{z} \equiv \frac{1}{N}\sum_{n=0}^{N-1}\mathbf{z}_n=\begin{bmatrix} \widehat{\mu}_x \\ \,\widehat{\mu}_y\,\end{bmatrix}\]` that consists of the *sample means* of the `$x_n$` and `$y_n$` components of `$\mathbf{z}_n$`. --- class: left, .toc[[✧](#toc)] #Variance of Bivariate Data The *variance* of the vector-valued times series `$\mathbf{z}_n$` is not a scalar or a vector, it is a `$2\times 2$` *matrix* `\[\mathbf{\Sigma}\equiv \frac{1}{N}\sum_{n=0}^{N-1}\left(\mathbf{z}_n-\mathbf{\mu}_\mathbf{z}\right)\left(\mathbf{z}_n-\mathbf{\mu}_\mathbf{z}\right)^T \]` where “`$T$`” is the *matrix transpose*, `$\mathbf{z}_n =\begin{bmatrix} x_n \\ y_n \end{bmatrix}$`, `$\mathbf{z}_n^T =\begin{bmatrix} x_n & y_n \end{bmatrix}$`. Carrying out the matrix multiplication leads to `\[\mathbf{\Sigma}= \frac{1}{N}\sum_{n=0}^{N-1} \begin{bmatrix} \left(x_n-\widehat{\mu}_x\right)^2 & \left(x_n-\widehat{\mu}_x\right)\left(y_n-\widehat{\mu}_y\right)\\ \left(x_n-\widehat{\mu}_x\right)\left(y_n-\widehat{\mu}_y\right) &\left(y_n-\widehat{\mu}_y\right)^2 \end{bmatrix} \]` The diagonal elements of `$\mathbf{\Sigma}$` are the sample variances `$\sigma_x^2$` and `$\sigma_y^2$`, while the off-diagonal gives the *covariance* between `$x_n$` and `$y_n$`. Note that the two off-diagonal elements are identical. --- class: left, .toc[[✧](#toc)] # Fourier transform The Fourier theory presented earlier for *scalar* time series is completely applicable to complex-valued time series, in discrete form (`$N$` even): `\begin{eqnarray} z_n & = & \frac{1}{N \Delta_t}\sum_{m=0}^{N/2} Z_m e^{i2\pi m n/N} & + \frac{1}{N \Delta_t}\sum_{m=N/2+1}^{N-1} Z_m e^{i2\pi m n/N}\\ & = & \frac{1}{N \Delta_t}\sum_{m=0}^{N/2} Z^+_m e^{i2\pi m n/N} & + \frac{1}{N \Delta_t}\sum_{m=1}^{N/2-1} Z^-_m e^{-i2\pi m n/N}. \end{eqnarray}` The first sum corresponds to **positive** frequencies, and the second sum to the associated **negative** frequencies (except the zero and Nyquist frequencies for `$m=0,N/2$`). --- class: left, .toc[[✧](#toc)] #Rotary Spectra `\begin{equation} z_n = \frac{1}{N \Delta_t}\sum_{m=0}^{N/2} Z^+_m e^{i2\pi m n/N} + \frac{1}{N \Delta_t}\sum_{m=1}^{N/2-1} Z^-_m e^{-i2\pi m n/N}. \end{equation}` This introduces the concept of *rotary spectrum*: `\begin{eqnarray} S(f_m>0) \equiv S^+(f_m) & \equiv & \lim_{N \rightarrow \infty} E\left\{ \frac{|Z^+_m|^2}{N} \right\} \quad \text{counterclockwise spectrum,}\\ S(f_m<0) \equiv S^-(-f_m) & \equiv & \lim_{N \rightarrow \infty} E\left\{ \frac{|Z^-_m|^2}{N} \right\} \quad \text{clockwise spectrum.}\\ \end{eqnarray}` `\[f_m = \frac{m}{N\Delta_t}, \quad m = 0,\ldots,N/2\]` This is very useful in geophysical fluid mechanics because counterclockwise motions are *cyclonic* in the northern hemisphere and clockwise motions are *anticyclonic*, and vice-versa in the southern hemisphere. --- class: left, .toc[[✧](#toc)] #Rotary variance Imagine you have only two opposite components present in your time series at frequency `$f_k$`: `\begin{eqnarray} z_n & = & Z_k^+ e^{i2\pi k n /N} + Z_k^- e^{-i2\pi k n /N} \\ & = & \left\{A^+ e^{i \phi^+} \right\} e^{i2\pi k n /N} + \left\{A^- e^{i \phi^-}\right\}e^{-i2\pi k n /N} \\ & = & e^{i\theta}\left\{ A \cos (2\pi k n/N + \phi) + i B \sin(2\pi k n/N + \phi) \right\} \end{eqnarray}` where `\begin{eqnarray} \theta & = & (\phi^+-\phi^-)/2\\ \phi & = & (\phi^++\phi^-)/2\\ A&=& A^++A^-\\ B &= & A^+-A^-. \\ \end{eqnarray}` --- class: left, .toc[[✧](#toc)] #Elliptic variance `\[ z_n = e^{i\theta}\left\{ A \cos (2\pi k n/N + \phi) + i B \sin(2\pi k n/N + \phi) \right\}\]` This is the equation for an ellipse oriented at an angle `$\theta$` from the `$x$` axis, with semi-major and semi-minor axes $A$ and $B$, respectively, rotating at frequency $f_k = k/(N\Delta_t)$, in the direction given by the sign of `$B$`.
See more details about elliptic variance in JML's Oslo lectures. --- class: left, .toc[[✧](#toc)] #Cartesian Spectra Rotary and Cartesian spectra are two alternate representation of the variance of the complex time series: `\begin{equation} z_n = \frac{1}{N \Delta_t}\sum_{m=0}^{N/2} Z^+_m e^{i2\pi m n/N} + \frac{1}{N \Delta_t}\sum_{m=1}^{N/2-1} Z^-_m e^{-i2\pi m n/N}. \end{equation}` `\begin{equation} \widehat{S}^+_m \equiv \frac{1}{N}\left|Z^+_m\right|^2, \quad \widehat{S}^-_m \equiv \frac{1}{N}\left|Z^-_m\right|^2 \quad \text{Rotary spectra estimates} \end{equation}` `\begin{equation} z_n = x_n+ i y_n = \frac{1}{N \Delta_t}\sum_{m=0}^{N-1} X_m e^{i2\pi m n/N} + i \left\{ \frac{1}{N \Delta_t}\sum_{m=0}^{N-1} Y_m e^{i2\pi m n/N}\right\}. \end{equation}` `\begin{equation} \widehat{S}^x_m \equiv \frac{1}{N}\left|X_m\right|^2, \quad \widehat{S}^y_m \equiv \frac{1}{N}\left|Y_m\right|^2 \quad \text{Cartesian spectra estimates} \end{equation}` --- class: left, .toc[[✧](#toc)] #Parseval theorem For bivariate data, the discrete form of the Parseval theorem takes the form: `\begin{eqnarray} \Delta_t \sum_{n=0}^{N-1} |z_n|^2 = \frac{1}{N\Delta_t} \sum_{m=0}^{N-1} |Z_m|^2 & = & \frac{1}{N\Delta_t} \sum_{m=0}^{N-1} |X_m|^2 + \frac{1}{N\Delta_t} \sum_{m=0}^{N-1} |Y_m|^2\\ & = & \frac{1}{N\Delta_t} \sum_{m=0}^{N/2} |Z^+_m|^2 + \frac{1}{N\Delta_t} \sum_{m=1}^{N/2-1} |Z^-_m|^2 \\ \end{eqnarray}` -- This shows that the total variance of the bivariate process is recovered completely by the Cartesian, or rotary Fourier representation. --- class: left, .toc[[✧](#toc)] #Example Hourly current meter record at 110 m depth from the Bravo mooring in the Labrador Sea, .cite[Lilly and Rhines (2002)]
--- class: left, .toc[[✧](#toc)] #Example 1 Hourly current meter record at 110 m depth from the Bravo mooring in the Labrador Sea, .cite[Lilly and Rhines (2002)]
--- class: left, .toc[[✧](#toc)] #Example 1 Hourly current meter record at 110 m depth from the Bravo mooring in the Labrador Sea, .cite[Lilly and Rhines (2002)]
--- class: left, .toc[[✧](#toc)] #Observable Features 1. The data consists of two time series that are similar in character. 1. Both time series present a superposition of scales. 1. At the smallest scale, there is an apparently oscillatory roughness which changes its amplitude in time. 1. A larger scale presents itself either as localized features, or as wavelike in nature. 1. Several sudden transitions are associated with isolated events. 1. Zooming in, we see the small-scale oscillatory behavior is sometimes `$90^\circ$` degrees out of phase, and sometimes `$180^\circ$`. 1. The amplitude of this oscillatory variability changes with time. The fact that the oscillatory behavior is not consistently `$90^\circ$` out of phase removes the possibility of these features being purely inertial oscillations. The amplitude modulation suggests tidal beating. -- The isolated events are eddies, which cause the currents to suddenly rotate as they pass by. The oscillations are due to tides and internal waves. --- class: left, .toc[[✧](#toc)] #Cartesian vs Rotary Spectra
--- class: left, .toc[[✧](#toc)] #Cartesian vs Rotary Spectra
--- class: left, .toc[[✧](#toc)] #Cartesian vs Rotary Spectra
--- class: left, .toc[[✧](#toc)] #Cartesian vs Rotary Spectra
--- class: left, .toc[[✧](#toc)] #Example Global zonally-averaged rotary spectra from hourly drifter velocities, see [Elipot et al. 2016](#http://dx.doi.org/10.1002/2016JC011716).
--- name: filtering class: center, middle, .toc[[✧](#toc)] # 5. Filtering and other topics --- class: left, .toc[[✧](#toc)] # Continuous Fourier We have considered the FT for a discrete time series `$x_n$`: `$$ x_n = \frac{1}{N\Delta_t}\sum_{m=0}^{N-1}X_me^{2\pi mn/N}, \quad X_m = \Delta_t \sum_{n=0}^{N-1}x_n e^{-i2\pi m n/N} $$` -- but it extends to continuous time series `$x(t)$`: `$$ \begin{equation} x(t) =\frac{1}{2\pi} \int_{-\infty}^{\infty} X(\omega)\, e^{i\omega t} d\omega,\quad\quad X(\omega)\equiv \int_{-\infty}^{\infty} x(t)\, e^{-i\omega t} d t. \end{equation} $$` Note that here we are using radian frequency `$\omega$`. -- The continuous notation is easier to understand the mechanics of *filtering* a time series, as well as spectral *blurring*. --- class: left, .toc[[✧](#toc)] ## The Spectrum (revisited) An alternative definition of the spectrum `$S(\omega)$` is that it is the Fourier transform of the autocorrelation function `$R(\tau)$`: `\[ S(\omega) \equiv \int_{-\infty}^\infty e^{-i \omega \tau} R(\tau) d\tau , \quad\quad R (\tau) = \frac{1}{2\pi}\int_{-\infty}^\infty e^{i \omega \tau} S(\omega) \, d\omega \]` -- This is called the *Wiener–Khintchine theorem*. The spectrum and the autocorrelation function are *Fourier transform pairs*. While both are essentially equivalent in that they capture the *same* second-order statistical information in different forms, the spectrum turns out to generally be far more illuminating, as well as easier to work with in practice. -- But the true autocorrelation function is not observable unless we have (i) infinite time and (ii) access to an abstract set of other universes where things might have happened differently! --- exclude: true class: left, .toc[[✧](#toc)] #Aliasing Any spectral estimate is distorted from `$S(\omega)$` in two important ways. The first is through *aliasing*. Imagine that our time series extends at discrete times into the infinite past and future, that is, we have `$z_n=z(n\Delta)$` for *all* positive and negative integers `$n$`, but not in between those times. In this case, it turns out that the spectrum can still be considered a function of continuous frequency `$\omega$`, but *only* up to the Nyquist at `$\omega=\pm \pi/\Delta_t$`. (Recall that `$f=1/(2\Delta_t)$` is the same as `$\omega= \pi/\Delta_t$`.) It can be shown (but not right now) that the spectrum then becomes `\[\sum_{p=-\infty}^{\infty }S\left(\omega + p \frac{2\pi }{\Delta_t} \right) \equiv S^{\Delta}(\omega)\]` which states that all frequencies higher or lower than `$\omega=\pm \pi/\Delta_t$` are *wrapped around* to the next resolved frequency. --- class: left, .toc[[✧](#toc)] # The Convolution Integral The *convolution* `$h(t)$` of a function `$f(t)$` and `$g(t)$` is defined as: `\[ h(t)\equiv \int_{-\infty}^{\infty} f(\tau) g(t-\tau) d\tau.\]` Note that in convolution, the order does not matter and we can show that `\[ h(t)\equiv \int_{-\infty}^{\infty} g(\tau) f(t-\tau) d\tau\]` This mathematical operation is actually what is being done when “smoothing” data. (It is like sliding the iron on the tablecloth, or pulling the tablecloth under a static iron). --- class: left, .toc[[✧](#toc)] # Convolution Theorem The *convolution theorem* states convolving `$f(t)$` and `$g(t)$` in the time domain is the same as a *multiplication* in the frequency domain. Let `$F(\omega)$` and `$G(\omega)$` be the Fourier transforms of `$f(t)$` and `$g(t)$`, respectively. It can be shown that if `\[h(t)= \int_{-\infty}^{\infty} f(\tau) g(t-\tau) d\tau\]` then the fourier transform of `$h(t)$` is `\[ H(\omega) = F(\omega) G(\omega).\]` -- This result is key to understand what happens in the Fourier domain when you perform a time-domain smoothing. --- class: left, .toc[[✧](#toc)] #Smoothing Now we consider what happens when we *smooth* the time series `$x(t)$` by the filter `$g(t)$` to obtain a smoothed version `$\widetilde x(t)$` of your time series: `\begin{eqnarray} \widetilde x(t)= \int_{-\infty}^{\infty} x(t-\tau) g(\tau) d\tau & \equiv & \frac{1}{2\pi} \int_{-\infty}^{\infty} \widetilde{X}(\omega) \, e^{i\omega t} d\omega.\\ &=& \frac{1}{2\pi}\int_{-\infty}^{\infty} X(\omega) G(\omega) \, e^{i\omega t} d\omega,\\ \end{eqnarray}` by the convolution theorem. When we perform simple smoothing, we are also reshaping the Fourier transform of the signal by *multiplying* its Fourier transform by that of the smoothing window. --- class: left, .toc[[✧](#toc)] #Three Window examples
--- class: left, .toc[[✧](#toc)] #Three Tapering Windows
--- class: left, .toc[[✧](#toc)] #Three Tapering Windows
--- class: left, .toc[[✧](#toc)] #Lowpass & Highpass Filters From the convolution theorem, we understand that filtering will keep the frequencies near zero but reject higher frequencies. For this reason they are called *low-pass filters*. The reverse type of filtration, rejecting the low frequencies but keeping the high frequencies, is called *high-pass filtering*. The residual `$\breve x(t)\equiv x(t) -\widetilde x(t)$` is an example of a high-pass filtered time series. In practice, to find the frequency form of your filter, you *pad it with zeros* so that it becomes the same length as your time series, and then you take its discrete Fourier transform. --- class: left, .toc[[✧](#toc)] # Convolution Theorem II This theorem is reciprocal: is your *multiply* in the time domain, you *convolve* in the Fourier domain. It can be shown that if `\[ h(t) = f(t) g(t)\]` then the fourier transform of `$h(t)$` is `\[ H(\omega) = \int_{-\infty}^{\infty} F(\nu) G(\omega -\nu) d\omega.\]` This result is key to understand what happens in the Fourier domain when you try to estimate spectra, i.e. *spectral bluring*, or to design band-pass filters. --- class: left, .toc[[✧](#toc)] # Bandpass filtering We can use the convolution theorem to build a band-pass filter. We want to modify the lowpass filter `$g(t)$` so that its Fourier transform is localized not about zero, but about some non-zero frequency `$\omega_o$`. To do this, we multiply `$g(t)$` by a complex exponential `$g(t) e^{i\omega_o t}$`. It can be shown (see Oslo lectures) that the Fourier transform of `$g(t) e^{i\omega_o t}$` is `$G(\omega-\omega_o)$`, which is localized around `$\omega_o$`. Thus, a convolution with `$g(t) e^{i\omega_o t}$` will *bandpass* the data in the vicinity of `$\omega_o$.` In fact, a lowpass filter is a particular type of bandpass in which the center of the *pass band* has been chosen as zero frequency. --- name: revisited class: left, .toc[[✧](#toc)] #Effect of Truncation Now imagine instead that we have a *continuously* sampled time series of length `$T$`, that is, we have `$z(t)$` but only between times `$-T/2$` and `$T/2$`. This is like multiplying `$z(t)$` by a function `$g(t)$` which is equal to one between `$-T/2$` and `$T/2$` and 0 otherwise: `\[ z_T(t) = g(t) \times z(t) \]` We will denote this truncted version of `$z(t)$` by `$z_T(t)$`. How does the spectrum compare of `$z_T(t)$` compare with that of `$z(t)$`? -- Q. Using one of the windows encountered today, how can we express the relationship between `$z(t)$` and `$z_T(t)$`? -- Q. Therefore, using another theorem learned today, what is the difference between their spectra? --- class: left, .toc[[✧](#toc)] #Spectral Blurring The spectrum of the truncated time series is *blurred* through smoothing with a function `$F_{T}(\omega)$` that is the *square* of the Fourier transform of a boxcar: `\[\widetilde S(\omega) \equiv\frac{1}{2\pi}\int_{-\infty}^\infty S(\nu) \,F_{T}(\nu-\omega)\, d \nu.\]` The smoothing function, which is known as the *Fejér kernel* `\[F_T(\omega)\equiv \int_{-T}^{T}\left(1-\frac{|\tau|}{T}\right) \, e^{i\omega\tau} \, d \tau =\frac{1}{T}\frac{\sin^2(\omega T/2)}{(\omega/2)^2}\]` is essentially a squared version of the “sinc” or `$\sin(x)/x$` function. However, `$\sin(x)/x$` is not a very smooth function at all! --- class: left, .toc[[✧](#toc)] #Multitapering Revisited We can now understand the purpose of multitapering. *Doing nothing* in your spectral estimate is equivalent to *truncating* your data, thus implicitly *smoothing* the true spectrum by an extremely undesirable function! The Fejér kernel has a major problem in that it is not *well concentrated*. Its “side lobes” are large, leading to a kind of error called *broadband bias*. This is the source of the error shown in the motivating example. Next we take a look at three different tapering functions and their squared Fourier transforms. The broadband bias is most clear if we use logarithmic scaling for the `$y$`-axis. --- class: left, .toc[[✧](#toc)] #Three Tapering Windows
--- class: left, .toc[[✧](#toc)] #Three Tapering Windows
--- class: left, .toc[[✧](#toc)] #Three Tapering Windows
--- name: epilogue class: left, .toc[[✧](#toc)] #Epilogue During the practical session this afternoon we will cover the material presented this morning, as well cover some of the topic of filtering. Thank you! Shane Elipot email:
selipot@rsmas.miami.edu


{% load static %}
{{ filename }}
Check the following:
manage.py collectstatic
was run during the most recent upgrade. This installs the most recent
iteration of each static file into the static root path.
STATIC_ROOT
path.
Refer to the installation
documentation for further guidance.
STATIC_ROOT: {{ settings.STATIC_ROOT }}
STATIC_URL: {{ settings.STATIC_URL }}
{{ filename }}
exists in the static root directory and is readable by the HTTP process.
Click here to attempt loading NetBox again.


This demo shows how the library can automatically re-initialize
in response to stylesheet switching. The box on the right lists the
color-related properties that apply to the
<h1>
element above; whenever the stylesheets change,
the list of properties will update automatically to reflect the new styles.
Use the selector below to switch between stylesheets, or use your browser's native switching mechanism if it has one.
→ Powered by
CSSUtilities


The result of a game in Tic-Tac-Toe Open on JetBrains Academy
Write a program that displays the result grid of a Tic-Tac-Toe game.

Memory limit: 256 MB
Time limit: 8 seconds
Show topic summary


## Introduction to Syncthing ![Syncthing logo][syncthing] * About me * Alex *<EMAIL_ADDRESS>/<EMAIL_ADDRESS>[syncthing]: img/syncthing_logo.png
## Tokyo Hackerspace ![Tokyo Hackerspace][thslogo] * [Events (Meetup)](https://www.meetup.com/TokyoHackerSpace/) * [TokyoHackerspace.org](https://www.tokyohackerspace.org) [thslogo]: img/thslogo.png
## Syncthing ![Syncthing logo][syncthing_logo] * Syncthing * https://syncthing.net/ * https://docs.syncthing.net/ [syncthing_logo]: img/syncthing_logo.png
![Syncthing logo][syncthing_logo] > Syncthing replaces proprietary sync and cloud services with something open, trustworthy and decentralized > Your data is your data alone and you deserve to choose where it is stored, if it is shared with some third party and how it's transmitted over the Internet. [syncthing_logo]: img/syncthing_logo.png
## Where does it fit? ![Many possibilities][solutions] [solutions]: img/solutions.png
* https://en.wikipedia.org/wiki/Comparison_of_file_synchronization_software * https://en.wikipedia.org/wiki/Zero-knowledge_proof
## What is Syncthing? * Open Source file synchronization agent * Cross-platform * Decentralized * Encrypted / authenticated
## What can Syncthing do? * Synchronize folder(s) between devices * Not a backup solution
## Demo
## Let's break things ! * Delete Sync folder * Conflict * Connectivity * Nested Sync folder (don't do this) * ...
# How does it work? * Open Protocol * No central server
## Synchronization * Folder ID * File Versioning * Conflict handling * Ignore pattern
## Synchronization * Send/Receive or Send only * Scan at fixed interval * Hidden folder * '.stfolder' * '.stversions' * '.stignore'
## Synchronization * What is synchronized? * File contents / modification time * What is not? * POSIX/NFS ACL, hard link... * How? * File are segmented into blocks * Renaming / moving file * Partially transfered data
## The introducer * Remote device can be set as introducer * Can automatically add new devices * Only in caes of mutually shared folders * About automatically added devices
## Configuration * Web GUI * Listen to localhost by default * Consider security * Local config * xml * Private/public key
## Security * Encryption and Authentication using TLS * Both device authenticate using certificate * Device ID = TLS cert hash * Devices must be explicitly allowed
## Connectivity * TLS over 22000/TCP * Local discovery * 21027/UDP * Global discovery * UPnP / port forwarding * Relaying
## Server? * Syncthing Relay Server * Syncthing Discovery Server
## Privacy * Relay Server * Knows IP, device ID * Disvovery Server * Annoucement sent every 30min * Mapping between device ID and IP * Eavesdropper can know: * Machine running Syncthing * Their device IDs
## Reading Push Away Your Privacy: Precise User Tracking Based on TLS Client Certificate Authentication * [Paper](http://tma.ifip.org/wordpress/wp-content/uploads/2017/06/tma2017_paper2.pdf)
## Other features * Logs * stdout by default or file * Auditing log ('-audit')
## Syncthing versions * Syncthing Core * Syncthing-android * Syncthing-GTK * SyncTrayzor * Updates
## Starting Syncthing * As service * Windows * Task Scheduler * Start on Login * Linux * systemd server user/system * ...
# The good
# The bad
# The ugly
## Getting started * https://docs.syncthing.net/intro/getting-started.html#getting-started * https://docs.syncthing.net/users/autostart.html
## Stats * https://data.syncthing.net/


H.B. Woodrose
Recently, I ordered some seeds from the net, and never being allergic to anything else, had no fear of an allergic reaction. I'm 26, tripped a couple times on shrooms, once on lsd, all were enjoyable. Mindset and setting were good, alone in barracks room (I'm military, therefore the 'legal' highs). Scraped off coating w/ fingernail file (found this a good method) and crushed up 10 seeds, soaked in 10 oz. bottled water before ingesting. Had eaten about 5 hours earlier.
30 min. later, got nauseous and puked exorcist style into the bathroom sink. not too bad, mostly water, not much burn. About 30-45 min. after puking, wasn't feeling much, decided to use the sublingual method reported on this site for 6 seeds, crushed up, put in 1 oz. bottled water for about 5 min., held in mouth for about 20 min, spit out. 20-30 min. later, no effects, except for face turning red,(warmth in face). I Repeated the same dose/method done again, only the coating was not scraped off as well in the interest of time.
About 10-20 min. later, I started noticing extreme redness in the face/neck, and very many red spots all over arms and back and chest. Had never had an allergic reaction to any substance before, but I knew this was what it must be. Would've went to the hospital, but, as I said, I'm military, so going to the hospital and saying 'I just took 22 H.B. Woodrose seeds so I could trip' would be a bad idea. Felt a little mind trip, like a little lsd, but not a whole lot. Thought I might die. Not the 'oh no! I'm tripping!' gonna die, but the 'oh no' - 'my throat and sinuses are closing so I can't breathe' kind of die.
Was getting cold, so I lay down on the bed and covered up. Started shaking violently, and the little mind trip didn't help, but I'm a pretty calm person, so I talked myself down, stopped shaking, and went to sleep/waking dream state for a couple hours. Woke up, threw up again, as on the second subligual trial, I had ingested about half the solution (about 3 seeds worth) felt much better, still some redness, but no convulsions, no throat closing, etc. Slept for about 10 hrs, woke up the next day and felt normal. Think I may try the 2-step extraction using ethanol and naptha lighter fluid next time, as I seem to be allergic to these seeds. If you are thinking this is a good way to trip, apparently it works for some, but I would suggest taking a very small dose (2-3 seeds), then waiting for a couple of hours to see if you are allergic first.
Happy tripping!
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


QMF uses AMQP Messaging (QPid) as its means of communication. To use QMF, Qpid messaging must be installed somewhere in the network. Qpid can be downloaded as source from Apache, is packaged with a number of Linux distributions, and can be purchased from commercial vendors that use Qpid. Please see http://qpid.apache.orgfor information as to where to get Qpid Messaging.
Qpid Messaging includes a message broker (qpidd) which typically runs as a daemon on a system. It also includes client bindings in various programming languages. The Python-language client library includes the QMF console libraries needed for this tutorial.
Please note that Qpid Messaging has two broker implementations. One is implemented in C++ and the other in Java. At press time, QMF is supported only by the C++ broker.
If the goal is to get the tutorial examples up and running as quickly as possible, all of the Qpid components can be installed on a single system (even a laptop). For more realistic deployments, the broker can be deployed on a server and the client/QMF libraries installed on other systems.
The Python console API for QMF can be used in a synchronous style, an asynchronous style, or a combination of both. Synchronous operations are conceptually simple and are well suited for user-interactive tasks. All operations are performed in the context of a Python function call. If communication over the message bus is required to complete an operation, the function call blocks and waits for the expected result (or timeout failure) before returning control to the caller.
For the purposes of this tutorial, code examples will be shown as they are entered in an interactive python session.
$ python Python 2.5.2 (r252:60911, Sep 30 2008, 15:41:38) [GCC 4.3.2 20080917 (Red Hat 4.3.2-4)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>>
We will begin by importing the required libraries. If the Python client is properly installed, these libraries will be found normally by the Python interpreter.
>>> from qmf.console import Session
We must now create a Session object to manage this QMF console session.
>>> sess = Session()
If no arguments are supplied to the creation of Session, it defaults to synchronous-only operation. It also defaults to user-management of connections. More on this in a moment.
We will now establish a connection to the messaging broker. If the broker daemon is running on the local host, simply use the following:
>>> broker = sess.addBroker()
If the messaging broker is on a remote host, supply the URL to the broker in the addBroker function call. Here's how to connect to a local broker using the URL.
>>> broker = sess.addBroker("amqp://localhost")
The call to addBroker is synchronous and will return only after the connection has been successfully established or has failed. If a failure occurs, addBroker will raise an exception that can be handled by the console script.
>>> try: ... broker = sess.addBroker("amqp://localhost:1000") ... except: ... print "Connection Failed" ... Connection Failed >>>
This operation fails because there is no Qpid Messaging broker listening on port 1000 (the default port for qpidd is 5672).
If preferred, the QMF session can manage the connection for you. In this case, addBroker returns immediately and the session attempts to establish the connection in the background. This will be covered in detail in the section on asynchronous operations.
The Python console API provides access to remotely managed objects via a proxy model. The API gives the client an object that serves as a proxy representing the "real" object being managed on the agent application. Operations performed on the proxy result in the same operations on the real object.
The following examples assume prior knowledge of the kinds of objects that are actually available to be managed. There is a section later in this tutorial that describes how to discover what is manageable on the QMF bus.
Proxy objects are obtained by calling the Session.getObjects function.
To illustrate, we'll get a list of objects representing queues in the message broker itself.
>>> queues = sess.getObjects(_class="queue", _package="org.apache.qpid.broker")
queues is an array of proxy objects representing real queues on the message broker. A proxy object can be printed to display a description of the object.
>>> for q in queues: ... print q ... org.apache.qpid.broker:queue[0-1537-1-0-58] 0-0-1-0-1152921504606846979:reply-localhost.localdomain.32004 org.apache.qpid.broker:queue[0-1537-1-0-61] 0-0-1-0-1152921504606846979:topic-localhost.localdomain.32004 >>>
Let us now focus our attention on one of the queue objects.
>>> queue = queues[0]
The attributes of an object are partitioned into properties and statistics. Though the distinction is somewhat arbitrary, properties tend to be fairly static and may also be large and statistics tend to change rapidly and are relatively small (counters, etc.).
There are two ways to view the properties of an object. An array of properties can be obtained using the getProperties function:
>>> props = queue.getProperties() >>> for prop in props: ... print prop ... (vhostRef, 0-0-1-0-1152921504606846979) (name, u'reply-localhost.localdomain.32004') (durable, False) (autoDelete, True) (exclusive, True) (arguments, {}) >>>
The getProperties function returns an array of tuples. Each tuple consists of the property descriptor and the property value.
A more convenient way to access properties is by using the attribute of the proxy object directly:
>>> queue.autoDelete True >>> queue.name u'reply-localhost.localdomain.32004' >>>
Statistics are accessed in the same way:
>>> stats = queue.getStatistics() >>> for stat in stats: ... print stat ... (msgTotalEnqueues, 53) (msgTotalDequeues, 53) (msgTxnEnqueues, 0) (msgTxnDequeues, 0) (msgPersistEnqueues, 0) (msgPersistDequeues, 0) (msgDepth, 0) (byteDepth, 0) (byteTotalEnqueues, 19116) (byteTotalDequeues, 19116) (byteTxnEnqueues, 0) (byteTxnDequeues, 0) (bytePersistEnqueues, 0) (bytePersistDequeues, 0) (consumerCount, 1) (consumerCountHigh, 1) (consumerCountLow, 1) (bindingCount, 2) (bindingCountHigh, 2) (bindingCountLow, 2) (unackedMessages, 0) (unackedMessagesHigh, 0) (unackedMessagesLow, 0) (messageLatencySamples, 0) (messageLatencyMin, 0) (messageLatencyMax, 0) (messageLatencyAverage, 0) >>>
or alternatively:
>>> queue.byteTotalEnqueues 19116 >>>
The proxy objects do not automatically track changes that occur on the real objects. For example, if the real queue enqueues more bytes, viewing the byteTotalEnqueues statistic will show the same number as it did the first time. To get updated data on a proxy object, use the update function call:
>>> queue.update() >>> queue.byteTotalEnqueues 19783 >>>
The update method was added after the M4 release of Qpid/Qmf. It may not be available in your distribution.
Up to this point, we have used the QMF Console API to find managed objects and view their attributes, a read-only activity. The next topic to illustrate is how to invoke a method on a managed object. Methods allow consoles to control the managed agents by either triggering a one-time action or by changing the values of attributes in an object.
First, we'll cover some background information about methods. A QMF object class (of which a QMF object is an instance), may have zero or more methods. To obtain a list of methods available for an object, use the getMethods function.
>>> methodList = queue.getMethods()
getMethods returns an array of method descriptors (of type qmf.console.SchemaMethod). To get a summary of a method, you can simply print it. The _repr_ function returns a string that looks like a function prototype.
>>> print methodList [purge(request)] >>>
For the purposes of illustration, we'll use a more interesting method available on the broker object which represents the connected Qpid message broker.
>>> br = sess.getObjects(_class="broker", _package="org.apache.qpid.broker")[0] >>> mlist = br.getMethods() >>> for m in mlist: ... print m ... echo(sequence, body) connect(host, port, durable, authMechanism, username, password, transport) queueMoveMessages(srcQueue, destQueue, qty) >>>
We have just learned that the broker object has three methods: echo, connect, and queueMoveMessages. We'll use the echo method to "ping" the broker.
>>> result = br.echo(1, "Message Body") >>> print result OK (0) - {'body': u'Message Body', 'sequence': 1} >>> print result.status 0 >>> print result.text OK >>> print result.outArgs {'body': u'Message Body', 'sequence': 1} >>>
In the above example, we have invoked the echo method on the instance of the broker designated by the proxy "br" with a sequence argument of 1 and a body argument of "Message Body". The result indicates success and contains the output arguments (in this case copies of the input arguments).
To be more precise... Calling echo on the proxy causes the input arguments to be marshalled and sent to the remote agent where the method is executed. Once the method execution completes, the output arguments are marshalled and sent back to the console to be stored in the method result.
You are probably wondering how you are supposed to know what types the arguments are and which arguments are input, which are output, or which are both. This will be addressed later in the "Discovering what Kinds of Objects are Available" section.
QMF is built on top of a middleware messaging layer (Qpid Messaging). Because of this, QMF can use some communication patterns that are difficult to implement using network transports like UDP, TCP, or SSL. One of these patterns is called the Publication and Subscription pattern (pub-sub for short). In the pub-sub pattern, data sources publish information without a particular destination in mind. Data sinks (destinations) subscribe using a set of criteria that describes what kind of data they are interested in receiving. Data published by a source may be received by zero, one, or many subscribers.
QMF uses the pub-sub pattern to distribute events, object creation and deletion, and changes to properties and statistics. A console application using the QMF Console API can receive these asynchronous and unsolicited events and updates. This is useful for applications that store and analyze events and/or statistics. It is also useful for applications that react to certain events or conditions.
Note that console applications may always use the synchronous mechanisms.
Asynchronous API operation occurs when the console application supplies a Console object to the session manager. The Console object (which overrides the qmf.console.Console class) handles all asynchronously arriving data. The Console class has the following methods. Any number of these methods may be overridden by the console application. Any method that is not overridden defaults to a null handler which takes no action when invoked.
Table 2.4. QMF Python Console Class Methods
| Method | Arguments | Invoked when... |
| brokerConnected | broker | a connection to a broker is established |
| brokerDisconnected | broker | a connection to a broker is lost |
| newPackage | name | a new package is seen on the QMF bus |
| newClass | kind, classKey | a new class (event or object) is seen on the QMF bus |
| newAgent | agent | a new agent appears on the QMF bus |
| delAgent | agent | an agent disconnects from the QMF bus |
| objectProps | broker, object | the properties of an object are published |
| objectStats | broker, object | the statistics of an object are published |
| event | broker, event | an event is published |
| heartbeat | agent, timestamp | a heartbeat is published by an agent |
| brokerInfo | broker | information about a connected broker is available to be queried |
| methodResponse | broker, seq, response | the result of an asynchronous method call is received |
Supplied with the API is a class called DebugConsole. This is a test Console instance that overrides all of the methods such that arriving asynchronous data is printed to the screen. This can be used to see all of the arriving asynchronous data.
We'll start the example from the beginning to illustrate the reception and handling of events. In this example, we will create a Console class that handles broker-connect, broker-disconnect, and event messages. We will also allow the session manager to manage the broker connection for us.
Begin by importing the necessary classes:
>>> from qmf.console import Session, Console
Now, create a subclass of Console that handles the three message types:
>>> class EventConsole(Console): ... def brokerConnected(self, broker): ... print "brokerConnected:", broker ... def brokerDisconnected(self, broker): ... print "brokerDisconnected:", broker ... def event(self, broker, event): ... print "event:", event ... >>>
Make an instance of the new class:
>>> myConsole = EventConsole()
Create a Session class using the console instance. In addition, we shall request that the session manager do the connection management for us. Notice also that we are requesting that the session manager not receive objects or heartbeats. Since this example is concerned only with events, we can optimize the use of the messaging bus by telling the session manager not to subscribe for object updates or heartbeats.
>>> sess = Session(myConsole, manageConnections=True, rcvObjects=False, rcvHeartbeats=False) >>> broker = sess.addBroker() >>>
Once the broker is added, we will begin to receive asynchronous events (assuming there is a functioning broker available to connect to).
brokerConnected: Broker connected at: localhost:5672 event: Thu Jan 29 19:53:19 2009 INFO org.apache.qpid.broker:bind broker=localhost:5672 ...
To illustrate asynchronous handling of objects, a small console program is supplied. The entire program is shown below for convenience. We will then go through it part-by-part to explain its design.
This console program receives object updates and displays a set of statistics as they change. It focuses on broker queue objects.
# Import needed classes from qmf.console import Session, Console from time import sleep # Declare a dictionary to map object-ids to queue names queueMap = {} # Customize the Console class to receive object updates. class MyConsole(Console): # Handle property updates def objectProps(self, broker, record): # Verify that we have received a queue object. Exit otherwise. classKey = record.getClassKey() if classKey.getClassName() != "queue": return # If this object has not been seen before, create a new mapping from objectID to name oid = record.getObjectId() if oid not in queueMap: queueMap[oid] = record.name # Handle statistic updates def objectStats(self, broker, record): # Ignore updates for objects that are not in the map oid = record.getObjectId() if oid not in queueMap: return # Print the queue name and some statistics print "%s: enqueues=%d dequeues=%d" % (queueMap[oid], record.msgTotalEnqueues, record.msgTotalDequeues) # if the delete-time is non-zero, this object has been deleted. Remove it from the map. if record.getTimestamps()[2] > 0: queueMap.pop(oid) # Create an instance of the QMF session manager. Set userBindings to True to allow # this program to choose which objects classes it is interested in. sess = Session(MyConsole(), manageConnections=True, rcvEvents=False, userBindings=True) # Register to receive updates for broker:queue objects. sess.bindClass("org.apache.qpid.broker", "queue") broker = sess.addBroker() # Suspend processing while the asynchronous operations proceed. try: while True: sleep(1) except: pass # Disconnect the broker before exiting. sess.delBroker(broker)
Before going through the code in detail, it is important to understand the differences between synchronous object access and asynchronous object access. When objects are obtained synchronously (using the getObjects function), the resulting proxy contains all of the object's attributes, both properties and statistics. When object data is published asynchronously, the properties and statistics are sent separately and only when the session first connects or when the content changes.
The script wishes to print the queue name with the updated statistics, but the queue name is only present with the properties. For this reason, the program needs to keep some state to correlate property updates with their corresponding statistic updates. This can be done using the ObjectId that uniquely identifies the object.
# If this object has not been seen before, create a new mapping from objectID to name oid = record.getObjectId() if oid not in queueMap: queueMap[oid] = record.name
The above code fragment gets the object ID from the proxy and checks to see if it is in the map (i.e. has been seen before). If it is not in the map, a new map entry is inserted mapping the object ID to the queue's name.
# if the delete-time is non-zero, this object has been deleted. Remove it from the map. if record.getTimestamps()[2] > 0: queueMap.pop(oid)
This code fragment detects the deletion of a managed object. After reporting the statistics, it checks the timestamps of the proxy. getTimestamps returns a list of timestamps in the order:
Current - The timestamp of the sending of this update.
Create - The time of the object's creation
Delete - The time of the object's deletion (or zero if not deleted)
This code structure is useful for getting information about very-short-lived objects. It is possible that an object will be created, used, and deleted within an update interval. In this case, the property update will arrive first, followed by the statistic update. Both will indicate that the object has been deleted but a full accounting of the object's existence and final state is reported.
# Create an instance of the QMF session manager. Set userBindings to True to allow # this program to choose which objects classes it is interested in. sess = Session(MyConsole(), manageConnections=True, rcvEvents=False, userBindings=True) # Register to receive updates for broker:queue objects. sess.bindClass("org.apache.qpid.broker", "queue")
The above code is illustrative of the way a console application can tune its use of the QMF bus. Note that rcvEvents is set to False. This prevents the reception of events. Note also the use of userBindings=True and the call to sess.bindClass. If userBindings is set to False (its default), the session will receive object updates for all classes of object. In the case above, the application is only interested in broker:queue objects and reduces its bus bandwidth usage by requesting updates to only that class. bindClass may be called as many times as desired to add classes to the list of subscribed classes.
Method calls can also be invoked asynchronously. This is useful if a large number of calls needs to be made in a short time because the console application will not need to wait for the complete round-trip delay for each call.
Method calls are synchronous by default. They can be made asynchronous by adding the keyword-argument _async=True to the method call.
In a synchronous method call, the return value is the method result. When a method is called asynchronously, the return value is a sequence number that can be used to correlate the eventual result to the request. This sequence number is passed as an argument to the methodResponse function in the Console interface.
It is important to realize that the methodResponse function may be invoked before the asynchronous call returns. Make sure your code is written to handle this possibility.
Apache Qpid, Messaging built on AMQP; Copyright © 2015 The Apache Software Foundation; Licensed under the Apache License, Version 2.0; Apache Qpid, Qpid, Qpid Proton, Proton, Apache, the Apache feather logo, and the Apache Qpid project logo are trademarks of The Apache Software Foundation; All other marks mentioned may be trademarks or registered trademarks of their respective owners


{{template:CanteenStyles}}
We have to update your database to the newest version. The update may take a little while, so please be patient.


Sipfra
Home
Dashboard TEmplate
Profile
About Us
Contact Us
Pricing
Starter Plan
Premium Plan
Business Plan
Settings
Users
Facebook
Instagram


Title
Title
Title
Title
Content
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc consectetur posuere dolor et aliquet. Morbi risus odio, posuere quis leo ut, iaculis consectetur est.
Content
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc consectetur posuere dolor et aliquet. Morbi risus odio, posuere quis leo ut, iaculis consectetur est.
Content
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc consectetur posuere dolor et aliquet. Morbi risus odio, posuere quis leo ut, iaculis consectetur est.
Content
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc consectetur posuere dolor et aliquet. Morbi risus odio, posuere quis leo ut, iaculis consectetur est.
Special title treatment
With supporting text below as a natural lead-in to additional content.
Go somewhereSpecial title treatment
With supporting text below as a natural lead-in to additional content.
Go somewhereSpecial title treatment
With supporting text below as a natural lead-in to additional content.
Go somewhereSpecial title treatment
With supporting text below as a natural lead-in to additional content.
Go somewhere| # | First Name | Last Name | Username |
|---|---|---|---|
| 1 | Mark | Otto | @mdo |
| 2 | Jacob | Thornton | @fat |
| 3 | Larry | the Bird | |
| 4 | Maya | Bubble |


Police Stops
Refine Your Search:
Stops from date:
to
Driver Gender:
All
Male
Female
Driver age range:
to
Driver Race:
Black
Hispanic
White
Asian
Other
Violation:
DUI
License
Equipment
Speeding
Paperwork
Other
Search Conducted:
All
Yes
No
Search Type:
Incident to Arrest
Consent
Warrant
Search Outcome:
Misdemeanor Arrest
Citation
Faulty Equipment Notice
Warning
Felony Arrest
Officer Gender:
All
Male
Female
Officer age range:
to
Officer Race:
Black
Hispanic
White
Asian
Other
Out-of-State Driver:
All
Yes
No
{% include "map.html" %}


|
Projects |
Hello, and welcome to www.joebott.com, my personal webpage a web site that exists.This website is mostly just a public place for my small programming projects garbage I wrote over a decade ago. Feel free to email me with comments on any of them laugh at me. Current Project: Nothing on here! Go poke at my GitHub repos instead. What You're Probably Here For: SneakyAmp 2.0. It is still marked as a beta version, but I've never heard any complaints about it, so download away! Certainly not an old Winamp plugin. Remember Winamp? |


|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.cilib.Container.Tree.GeneralTree
| Constructor Summary | |
GeneralTree()
|
|
GeneralTree(java.lang.Object object)
|
| Method Summary | |
void |
accept(Visitor v)
|
void |
add(GeneralTree generalTree)
Add a subtree to the current tree. |
int |
getDegree()
Get the degree of the current node |
java.lang.Object |
getNodeValue()
Returns the value the node is currently containing |
Tree |
getSubtree(int subtree)
Get the referance to the i-th child node to this parent node in the Tree |
boolean |
isEmpty()
Test if the value being held by the Tree is null |
boolean |
isLeafNode()
Determine if this node is a leaf node. |
java.lang.Object |
remove(int index)
Remove a subtree from the current Tree. |
void |
setNodeValue(java.lang.Object value)
Set the value of the current node |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public GeneralTree()
public GeneralTree(java.lang.Object object)
| Method Detail |
public void add(GeneralTree generalTree)
generalTree
- The GeneralTree to attach to the current treepublic java.lang.Object remove(int index)
index
will be lost.
index
- The index of the subtree to remove.
public void setNodeValue(java.lang.Object value)
setNodeValue
in interface Tree
value
- The value for the node to containpublic java.lang.Object getNodeValue()
getNodeValue
in interface Tree
Tree.getNodeValue()
public Tree getSubtree(int subtree)
getSubtree
in interface Tree
subtree
- The index of the subtree to return
Tree.getSubtree(int)
public boolean isLeafNode()
isLeafNode
in interface Tree
Tree.isLeafNode()
public boolean isEmpty()
isEmpty
in interface Tree
public void accept(Visitor v)
accept
in interface Tree
public int getDegree()
getDegree
in interface Tree
Tree.getDegree()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |


Address Information
From Address
Your Name
Company
Country/Location
India
Address

Postal Code
City
State
Phone
Email
VAT/CST/TIN no.
To Address
Your Name
Company
Country/Location
India
Address

Postal Code
City
State
Phone
Email
VAT/CST/TIN no.


|
SharpNEAT
C# implementation of NEAT
|
Leaky rectified linear activation unit (ReLU). Shifted on the x-axis so that x=0 gives y=0.5, in keeping with the logistic sigmoid. More...
Public Member Functions | |
| double | Calculate (double x, double[] auxArgs) |
| Calculates the output value for the specified input value and optional activation function auxiliary arguments. More... | |
| float | Calculate (float x, float[] auxArgs) |
| Calculates the output value for the specified input value and optional activation function auxiliary arguments. This single precision overload of Calculate() will be used in neural network code that has been specifically written to use floats instead of doubles. More... | |
| double[] | GetRandomAuxArgs (IRandomSource rng, double connectionWeightRange) |
| For activation functions that accept auxiliary arguments; generates random initial values for aux arguments for newly added nodes (from an 'add neuron' mutation). More... | |
| void | MutateAuxArgs (double[] auxArgs, IRandomSource rng, double connectionWeightRange) |
| Genetic mutation for auxiliary argument data. More... | |
Public Attributes | |
| string | FunctionId => this.GetType().Name |
| string | FunctionString => "" |
| string | FunctionDescription => "Leaky Rectified Linear Unit (ReLU) with X-axis translation." |
| bool | AcceptsAuxArgs => false |
Static Public Attributes | |
| static readonly IActivationFunction | __DefaultInstance = new LeakyReLUShifted() |
| Default instance provided as a public static field. More... | |
Additional Inherited Members | |
| Properties inherited from SharpNeat.Network.IActivationFunction | |
| string | FunctionId [get] |
| Gets the unique ID of the function. Stored in network XML to identify which function a network or neuron is using. More... | |
| string | FunctionString [get] |
| Gets a human readable string representation of the function. E.g 'y=1/x'. More... | |
| string | FunctionDescription [get] |
| Gets a human readable verbose description of the activation function. More... | |
| bool | AcceptsAuxArgs [get] |
| Gets a flag that indicates if the activation function accepts auxiliary arguments. More... | |
Leaky rectified linear activation unit (ReLU). Shifted on the x-axis so that x=0 gives y=0.5, in keeping with the logistic sigmoid.
| double SharpNeat.Network.LeakyReLUShifted.Calculate | ( | double | x, |
| double[] | auxArgs | ||
| ) |
Calculates the output value for the specified input value and optional activation function auxiliary arguments.
Implements SharpNeat.Network.IActivationFunction.
| float SharpNeat.Network.LeakyReLUShifted.Calculate | ( | float | x, |
| float[] | auxArgs | ||
| ) |
Calculates the output value for the specified input value and optional activation function auxiliary arguments. This single precision overload of Calculate() will be used in neural network code that has been specifically written to use floats instead of doubles.
Implements SharpNeat.Network.IActivationFunction.
| double [] SharpNeat.Network.LeakyReLUShifted.GetRandomAuxArgs | ( | IRandomSource | rng, |
| double | connectionWeightRange | ||
| ) |
For activation functions that accept auxiliary arguments; generates random initial values for aux arguments for newly added nodes (from an 'add neuron' mutation).
Implements SharpNeat.Network.IActivationFunction.
| void SharpNeat.Network.LeakyReLUShifted.MutateAuxArgs | ( | double[] | auxArgs, |
| IRandomSource | rng, | ||
| double | connectionWeightRange | ||
| ) |
Genetic mutation for auxiliary argument data.
Implements SharpNeat.Network.IActivationFunction.
|
static |
Default instance provided as a public static field.


Action to be taken if you find a fire in your area: Remember the Acronyms "RACE" and "PASS"
R - Rescue, endangered Patient and/or personnel from immediate area. A - Alarm, pull fire alarm and dial 475-4444 give exact location: floor, room number, and type of fire. C – Continue, “Seal Off” the room by closing the doors to prevent spread of combustion by products, if time permits. E – Extinguish, you may attempt to extinguish the fire by using a proper fire extinguisher, provided you do not endanger yourself or others.
YOU SHOULD PREPARE TO EVACUATE IF SO DIRECTED BY FIRE DEPARTMENT PERSONNEL OR SENIOR MILITARY ON THE SCENE. Rescue, Alarm, Confine, & Extinguish or Evacuate Use of fire extinguisher remember “ PASS”
P – Pull the pin on the fire extinguisher. A – Aim the nozzle at the base of the fire. S – Squeeze the handle to release the extinguishing agent. S – Sweep from side to side. Pull, Aim, Squeeze and Sweep