This section describes the script found in
$PROX_HOME/doc/user/tutorial/examples/generate-iid-data.py
.
Import needed classes.
from kdl.prox.datagen2.structure import SyntheticGraphIID from kdl.prox.datagen2.attributes import AttributeGenerator from kdl.prox.model2.rpt import RPT from kdl.prox.util.stat import NormalDistribution from java.io import File
Define a helper function that loads an RPT from a file.
def loadRPT(modelFile): return RPT().load(modelFile) def loadFile(fileName): return File(fileName)
Data generation requires an empty database. Check to see if the
database already contains data so we can warn users accordingly.
The method isProxTablesEmpty()
returns true if the top-level tables are defined and empty.
isEmpty = DB.isProxTablesEmpty()
If the database is not empty, ask the user whether to overwrite the existing data.
genData = 1 if (not isEmpty): prompt = "Database is not empty. Overwrite existing data?" genData = prox.getYesNoFromUser(prompt)
Do nothing if the database is not empty and the user says not to overwrite the existing data.
if (not genData): print 'No data generated'
Continue with data generation if the database is empty or if the user says to overwrite existing data.
Clear and initialize the database.
else: print 'Clearing database' DB.clearDB() print 'Initializing database' DB.initEmptyDB()
To define the i.i.d structure, we specify a probability distribution over degree distributions for the S objects. This script creates connected components with two different degree distributions for the S objects. One half of the S objects have normally distributed degrees with a mean of 2 and standard deviation approaching zero. The second half have normally distributed degrees with a mean of 5 and standard deviation of 1. The exact number of components having each of the specified degree distributions is determined probabilistically so you may not end up with exactly two S objects for each degree distribution.
degreeDistribs = [[0.5, NormalDistribution(2.0, 0.0000001)], [0.5, NormalDistribution(5.0, 1.0)]]
Generate the i.i.d. graph structure by calling a constructor for
the SyntheticGraphIID
class.
The SyntheticGraphIID
generator creates objects and gives them
a type (saved in an objecttype attribute):
S for the core objects and
T for the peripheral objects (the objects
linked to the core S objects). Generating
i.i.d. data is unique in this regard—other
structure generators do not attach any attributes to the objects or
links that they create. The generated data will
include four S objects.
print 'creating graph structure' SyntheticGraphIID(4, degreeDistribs)
After creating the structure, we generate the attribute values. Note that the attribute generator can only generate attributes on objects and that all attributes are string valued.
We use a
relational dependency network
(RDN) to generate the
values for the attributes. The attribute names and their
distributions are specified by the constituent models of this RDN in
the form of
relational probability trees
(RPTs).
The data generator requires one RPT
and one query
for each attribute
in the generated data. In this example, we provide an RPT for the
S class labels and one each
for the other attributes on S and
T objects.
For each each attribute in the generated data, the attribute
generator executes a query that produces subgraphs having the
structure required by the corresponding RPT, saving the results in
a temporary container. For example, the
iid-coreS-query
query creates the 1d-star
subgraphs required by the RPT for the
s_attr0_label attribute
(s-attr-rpt.xml
).
The data generation process iterates the specified number of times, applying the RPTs one by one to the subgraphs in the corresponding container, in a random order. Applying the RPT predicts values for the associated attribute, which are recorded in the database. The values predicted by one application of the RPT are used as input to succeeding applications. In this way, the attribute values change over time (are conditioned) from their initial random values to values consistent with the provided model. See Chapter 7, Learning Models for more information on RPTs and RDNs.
The attribute generator
appends the string “_label
” and
prepends “s_
” or
“t_
” as appropriate to the attribute
names specified in the RPTs. For example, if you specify an attribute
named “class” in
s-class-rpt.xml
, the S objects will be given an attribute named
s_class_label. Similarly, specifying an
attribute named “attr1
” in
t-attr-rpt.xml
results in an attribute named
t_attr1_label in the generated
data. Although Proximity modifies the final attribute names as outlined
above, all attribute names must be unique within the RPT files.
Proximity requires that the RPT and query files be in the
current working directory ($PROX_HOME
if you are
following the tutorial).
print 'generating i.i.d. attributes' sClassQuery = loadFile("iid-class-query.xml") sClassRPT = loadRPT("s-class-rpt.xml") sAttrQuery = loadFile("iid-coreS-query.xml") sAttrRPT = loadRPT("s-attr-rpt.xml") tAttrQuery = loadFile("iid-coreT-query.xml") tAttrRPT = loadRPT("t-attr-rpt.xml")
The first two queries get the 1d-stars for each
S object—all the
T objects connected to their core
S objects.
The last query, iid-coreT-query
,
gets the 2d-stars for each T
object—for each T object it finds
any connected S objects and any
T objects connected to those
S objects.
The S class RPT
(s-class-rpt.xml
) infers the value of
s_class_label based on the degree of the
S objects. The other two RPTs infer
the value of their respective attributes based on the value of
s_class_label for the current object (for
s-attr-rpt
) or linked S
objects (for t-attr-rpt
).
Store the queries and RPTs in a Python dictionary that pairs queries with the RPTs that specify the corresponding attributes.
queriesAndModels = {sClassQuery: sClassRPT, \ sAttrQuery: sAttrRPT, tAttrQuery: tAttrRPT}
Specify the number of Gibbs sampling iterations to use in conditioning the data.
iters = 3
To generate the attribute values, we call a constructor for the
AttributeGenerator
class.
AttributeGenerator(queriesAndModels, iters)
Exercise 6.8. Generating synthetic i.i.d. data:
|
The i.i.d. data generation script clears and overwrites the current database. Make sure that you are serving an empty or test database. |
All RPT
files required for this exercise must be
available in the current working directory
($PROX_HOME
if you are
following the tutorial). Copy the required files to the correct
directory.
>cd $PROX_HOME
>cp $PROX_HOME/doc/user/tutorial/examples/s-class-rpt.xml .
>cp $PROX_HOME/doc/user/tutorial/examples/s-attr-rpt.xml .
>cp $PROX_HOME/doc/user/tutorial/examples/t-attr-rpt.xml .
>cp $PROX_HOME/doc/user/tutorial/examples/iid-class-query.xml .
>cp $PROX_HOME/doc/user/tutorial/examples/iid-coreS-query.xml .
>cp $PROX_HOME/doc/user/tutorial/examples/iid-coreT-query.xml .
The DTD describing the RPT format must be present in the same directory as the RPT files. If you have not already done so, copy this file to the current working directory.
> cp $PROX_HOME/resources/rpt2.dtd .
Serve a new (empty) database.
> Mserver --dbname DataGen_IID $PROX_HOME/resources/init-mserver.mil
Remember to use a port number > 40000 if you are using MonetDB 4.6.2.
Initialize the new Proximity database. Substitute the appropriate host and port information if you are running the MonetDB server on a different machine or are using a different port.
>cd $PROX_HOME
>bin/db-util.sh localhost:30000 init-db
Start the Proximity Database Browser.
From the Script menu, choose Run Script. Proximity displays the Open dialog.
Navigate to the $PROX_HOME/doc/user/tutorial/examples
directory and
choose generate-iid-data.py
.
Click Open.
Proximity opens a window to show you any output from the script along with a trace of the script execution. The final lines of your output should look similar to the following (leading information showing elapsed time and execution thread has been omitted from the trace for brevity):
INFO kdl.prox.qgraph2.QueryGraph2CompOp - * done executing query INFO kdl.prox.model2.rdn.RDN - RDN Iteration: 0 Status: finished running script
You can close this window after the script finishes.
Examine the generated objects and attributes in the
Proximity Database Browser. You may want to execute a 1d-star query that
finds all T objects directly connected to
each S object (for example,
iid-coreS-query.xml
). The subgraphs created by
such a query are shown below. The results of each data
generation run will be different and your results will not necessarily
look exactly like that shown here.


See: Description
| Class | Description |
|---|---|
| CoreDispatchLayerFactory |
Factory for creating core dispatch layers.
|
| ErrorBounce |
Receives job events, checks to see whether any parameters in the job are
error tokens or collections which contain errors.
|
| Failover |
Failure handling dispatch layer, consumes job events with multiple activities
and emits the same job but with only the first activity.
|
| IntermediateProvenance |
Sits above the
Invoke layer and collects information about the
current workflow run to be stored by the ProvenanceConnector . |
| Invoke |
Context free invoker layer, does not pass index arrays of jobs into activity
instances.
|
| Loop |
A layer that allows while-style loops.
|
| LoopConfiguration |
Configuration bean for the
Loop . |
| Parallelize |
Dispatch layer which consumes a queue of events and fires off a fixed number
of simultaneous jobs to the layer below.
|
| ParallelizeConfig |
Bean to hold the configuration for the parallelize layer, specifically a
single int property defining the number of concurrent jobs in that processor
instance per owning process ID.
|
| Retry |
Implements retry policy with delay between retries and exponential backoff
|
| RetryConfig | |
| Stop |
This layer allows for the cancellation, pausing and resuming of workflow
runs.
|
Copyright © 2015–2016 The Apache Software Foundation. All rights reserved.


|
QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.30
|
Iterator advancing in constant steps. More...
#include <ql/utilities/steppingiterator.hpp>
Public Types | |
| using | iterator_category = typename std::iterator_traits< Iterator >::iterator_category |
| using | difference_type = typename std::iterator_traits< Iterator >::difference_type |
| using | value_type = typename std::iterator_traits< Iterator >::value_type |
| using | pointer = typename std::iterator_traits< Iterator >::pointer |
| using | reference = typename std::iterator_traits< Iterator >::reference |
Public Member Functions | |
| step_iterator ()=default | |
| step_iterator (const Iterator &base, Size step) | |
| template<class OtherIterator > | |
| step_iterator (const step_iterator< OtherIterator > &i, typename std::enable_if< std::is_convertible< OtherIterator, Iterator >::value >::type *=0) | |
| Size | step () const |
| Iterator | base () const |
| void | increment () |
| void | decrement () |
| void | advance (typename std::iterator_traits< Iterator >::difference_type n) |
| std::iterator_traits< Iterator >::difference_type | distance_to (const step_iterator &i) const |
| step_iterator & | operator= (const step_iterator &other) |
| step_iterator & | operator++ () |
| step_iterator | operator++ (int) |
| reference | operator* () const |
| step_iterator & | operator-- () |
| step_iterator | operator-- (int) |
| step_iterator & | operator+= (Size n) |
| step_iterator & | operator-= (Size n) |
| reference | operator[] (Size n) const |
Private Attributes | |
| Iterator | base_ {} |
| BigInteger | step_ {} |
Friends | |
| step_iterator | operator+ (const step_iterator &i, Size n) |
| step_iterator | operator+ (Size n, const step_iterator &i) |
| step_iterator | operator- (const step_iterator &i, Size n) |
| difference_type | operator- (const step_iterator &lhs, const step_iterator &rhs) |
| bool | operator== (const step_iterator &lhs, const step_iterator &rhs) |
| bool | operator!= (const step_iterator &lhs, const step_iterator &rhs) |
| bool | operator< (const step_iterator &lhs, const step_iterator &rhs) |
| bool | operator> (const step_iterator &lhs, const step_iterator &rhs) |
| bool | operator<= (const step_iterator &lhs, const step_iterator &rhs) |
| bool | operator>= (const step_iterator &lhs, const step_iterator &rhs) |
Related Functions | |
(Note that these are not member functions.) | |
| template<class Iterator > | |
| step_iterator< Iterator > | make_step_iterator (Iterator it, Size step) |
| helper function to create step iterators More... | |
Iterator advancing in constant steps.
This iterator advances an underlying random-access iterator in steps of \( n \) positions, where \( n \) is a positive integer given upon construction.
Definition at line 44 of file steppingiterator.hpp.
| using iterator_category = typename std::iterator_traits<Iterator>::iterator_category |
Definition at line 51 of file steppingiterator.hpp.
| using difference_type = typename std::iterator_traits<Iterator>::difference_type |
Definition at line 52 of file steppingiterator.hpp.
| using value_type = typename std::iterator_traits<Iterator>::value_type |
Definition at line 53 of file steppingiterator.hpp.
| using pointer = typename std::iterator_traits<Iterator>::pointer |
Definition at line 54 of file steppingiterator.hpp.
| using reference = typename std::iterator_traits<Iterator>::reference |
Definition at line 55 of file steppingiterator.hpp.
|
default |
|
explicit |
Definition at line 59 of file steppingiterator.hpp.
| step_iterator | ( | const step_iterator< OtherIterator > & | i, |
| typename std::enable_if< std::is_convertible< OtherIterator, Iterator >::value >::type * | = 0 |
||
| ) |
Definition at line 63 of file steppingiterator.hpp.
| Size step | ( | ) | const |
Definition at line 69 of file steppingiterator.hpp.
| Iterator base | ( | ) | const |
Definition at line 75 of file steppingiterator.hpp.
| void increment | ( | ) |
Definition at line 81 of file steppingiterator.hpp.
| void decrement | ( | ) |
Definition at line 89 of file steppingiterator.hpp.
| void advance | ( | typename std::iterator_traits< Iterator >::difference_type | n | ) |
Definition at line 97 of file steppingiterator.hpp.
| std::iterator_traits< Iterator >::difference_type distance_to | ( | const step_iterator< Iterator > & | i | ) | const |
Definition at line 106 of file steppingiterator.hpp.
| step_iterator & operator= | ( | const step_iterator< Iterator > & | other | ) |
Definition at line 110 of file steppingiterator.hpp.
| step_iterator & operator++ | ( | ) |
Definition at line 116 of file steppingiterator.hpp.
| step_iterator operator++ | ( | int | ) |
Definition at line 121 of file steppingiterator.hpp.
| reference operator* | ( | ) | const |
Definition at line 127 of file steppingiterator.hpp.
| step_iterator & operator-- | ( | ) |
Definition at line 131 of file steppingiterator.hpp.
| step_iterator operator-- | ( | int | ) |
Definition at line 136 of file steppingiterator.hpp.
| step_iterator & operator+= | ( | Size | n | ) |
Definition at line 142 of file steppingiterator.hpp.
| step_iterator & operator-= | ( | Size | n | ) |
Definition at line 147 of file steppingiterator.hpp.
Definition at line 152 of file steppingiterator.hpp.
|
friend |
Definition at line 156 of file steppingiterator.hpp.
|
friend |
Definition at line 160 of file steppingiterator.hpp.
|
friend |
Definition at line 164 of file steppingiterator.hpp.
|
friend |
Definition at line 168 of file steppingiterator.hpp.
|
friend |
Definition at line 175 of file steppingiterator.hpp.
|
friend |
Definition at line 179 of file steppingiterator.hpp.
|
friend |
Definition at line 183 of file steppingiterator.hpp.
|
friend |
Definition at line 190 of file steppingiterator.hpp.
|
friend |
Definition at line 197 of file steppingiterator.hpp.
|
friend |
Definition at line 204 of file steppingiterator.hpp.
|
related |
helper function to create step iterators
Definition at line 215 of file steppingiterator.hpp.
|
private |
Definition at line 46 of file steppingiterator.hpp.
|
private |
Definition at line 48 of file steppingiterator.hpp.


DiscoRound
Clown Vomit Mode
Status
History
Graph
URL
Response time
Status
{{#summary}}
{{name}}
{{responseTime}} ms
{{code}}
{{/summary}}
{{status}}
{{>result_table}}
Click for interactive graph.
{{flavor}}
You spin me right round baby, right round...


spearfishers catch species spearfishing coral Fig Barrier Great reef data location GBR catches estimated Reef regions time Coral {border-style Marine Sciences contribution px;} #ffffff;} spent Queensland additional proportional Australian Ecology fish fisheries functional inshore Table changes fishing offshore recreational region suggested Fish fishes reefs survey target using Click LINK Table). composition file. proportion size used (i.e. GBR[ greater impacts population GBR, included parrotfish total (coastal, Biology Choerodon N/A PERMANOVA South community dynamics group herbivores particularly potential significantly trout, tuskfish (North, Bellwood Central Life Reef. Threatened active analysis management participants px; recall significant spp. {font-family (DOCX) (e.g. Central, Fisheries However, IUCN List Mar North Project Red Reef, Res. Research Science Spatial Spearfishers coastal ecological fishery font-size groups important indicate inshore, interaction local locations patterns perceived preferences relative reported spear spearfisher study values ./journal.pone. Biology: Choat Mumby Plectropomus Reefs. SIMPER annual based coastal, double; factor herbivorous increased leopardus leopardus, observed offshore) online parrotfishes primary selectivity tuskfishes (or Aquatic Australia. Biol. Chlorurus Data Downloaded Ecol Environmental Herbivory Interactions: National Park Sci. South) Species. Survey Underwater average border-color border-width common compared competition declines differed differences distinct effect frequency global harvest highly information level line low operating percent reflect reproductive resilience responses result schoenleinii solid; spatial species[ surveys targeted trout years {font-style {font-weight (PERMANOVA, (Pannach (±SE) Biol Caribbean Catch Cooktown Department Despite Earth Effects GBR. Hoey Lethrinus Lutjanus Note Plant Queensland, Queensland. Recreational Results Scarus Science. Significant University abundance analysed behaviour bias biology bold bold. calculated caught change commercial commitment considered contributed courier; did distance ecosystem effort em; examined expected grouped high importance labelled large left likely marine methods number order perceptions practices predicted project pt;} reefs, reefs. reefs[ region. reproduction results selected small spearfishers, spearing varied


Lipsum
LOREM IPSUM DOLOR SIT AMET
consectetur adipisicing elit, sed do eiusmod tempor incididunt
FEATURED PRODUCTS
Lipsum comoodo Manager
The mission of Orlin Research, Inc. is to produce software products that multiply the power and efficiency of
empirical scientific research in the social sciences.
A central goal is to expand access to complex data sources and to the advanced methods of scientific investigation needed to analyze them.
A central goal is to expand access to complex data sources and to the advanced methods of scientific investigation needed to analyze them.
>
More
Contact Us
(626) 921-4592
(626) 921-4592
<EMAIL_ADDRESS>Orlin Research, Inc. 7412 Rigewood Ave Chevy Chase, MD 20815 USA
LATEST NEWS
27
NOV
An early access preview
An early access preview of the Orlin Data Manager is available...
17
DEC
An early access preview
An early access preview of the Orlin Data Manager is available...
21
DEC
An early access preview
An early access preview of the Orlin Data Manager is available...
WHO WE ARE?
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
>
More
OUR CLIENTS
Lipsum
HOME
ABOUT US
WORK
SERVICES
RESOURCES
ARTICLES
CONTACT
© 2009 Orlin Research, Inc


Welcome to a wonderful world of digitial crypto art starring our very own VRTK pig. Check out a selection of our digital cards of the VRTK pig in various character poses to celebrate the amazing range of virtual reality activities that are made possible by this wonderful technology.
You can own a piece of this collection by simply purchasing a digital VRTK card of varying rarity on the crypto blockchain using Ethereum.

Rarity: Common
100 total supply.

Rarity: Uncommon
50 total supply.
SUPER PIG
Is it a bird? Is it a plane? When pigs fly! Insert your own pun here and enjoy the rare card of our superhero VRTK pig.

BOWLING PIG
Gutterball, gutterball, strike! That's how we roll and that's how the epic card of the VRTK pig shows off his skills down on the lanes.
Rarity: Epic
10 total supply.

Rarity: Legendary
5 total supply.