[gecode-users] Extra information during propagation
Christian Schulte
cschulte at kth.se
Fri Jan 23 09:45:57 CET 2009
Hmmm, I would go for more info in the variables. While Gecode's variables
are incredibly slim, a variable always will have a couple of fields (for
Booleans it is for example 5 words, for integers at least 12) that adding
one more field will not hurt much.
I was about to write that advisors will not work but maybe they will: if you
have a UNIFY event and the variable operations emit that event then advisors
should also be executed.
Honestly, what you try to do sounds very scary to me and Gecode has not been
designed with something like that in mind. But: good luck!
Cheers
Christian
--
Christian Schulte, www.ict.kth.se/~cschulte/
-----Original Message-----
From: users-bounces at gecode.org [mailto:users-bounces at gecode.org] On Behalf
Of Vincent Barichard
Sent: Thursday, January 22, 2009 6:16 PM
To: Christian Schulte; users at gecode.org
Subject: Re: [gecode-users] Extra information during propagation
Hi Christian,
Le mercredi 21 janvier 2009 10:39:22 Christian Schulte, vous avez écrit :
> Hi Vincent,
>
> basically you want to have equivalence (or even equality) reasoning in
> Gecode. Gecode has been explicitly designed to not deal with it. Prior
> systems (logic programming based systems such as SICStus, Eclipse, Mozart,
> ...) do have equality reasoning (but typically with lots of restrictions
if
> not bugs). However my own experience has been that it is not useful enough
> (from a general perspective) and the chosen implementation technology
> (maintaining equivalence classes) is totally ill matched to performing
> propagation efficiently.
>
I agree. I don't want to perform a full equality reasoning.
> What would be possible on a general level is to use a substitution based
> approach. We know how to do it but it is a lot of work.
>
That's why I think about a "rewrite" approach where propagators are
rewritten
when they detect that two of their variables are the same.
> Okay that was just the background info and the answer that there is no
> general way and just fixing something in Gecode will not do the trick.
>
> Then what you might want to do is to define a new type of variables
> yourself that just extends Gecode variables by an additional level of
> indirection to do equivalence reasoning.
>
I began something like that. I have a new type of variables and propagators
over these variables.
When a variable has been found equal to another, I post a "domain equality"
propagator which ensures that the domains will be always equal. So, normal
propagators will be scheduled when domain of one of the two equal variables
will be updated.
Furthermore, a UNIFY event is emitted. But propagators which are able to
deal
with this event have to know which are the equal variables. How to get this
piece of information from the propagators?
I think about advisors (with the Delta parameter), but I don't know if it is
the right choice. I also think about creating an additional field in my new
variable type, but It will increase the size of the variable (so it will
lead
to increase the cloning time).
I am not sure of how to proceed to get the best efficiency.
> Hope that helps
Yes it helps a lot. Thank you very much.
Vincent
_______________________________________________
Gecode users mailing list
users at gecode.org
https://www.gecode.org/mailman/listinfo/gecode-users
More information about the gecode-users
mailing list


Passionate in everything
Here are some of the technologies I enjoy
Can contact via these links Google


---
layout: default
redirect_from: "/criterium"
date: 27/05/2021
---
Criterium Racing League
Event Information
- Start Date: 8th April, 2021
- End Date: 27th May, 2021
- Event Day & Time: Thursday, 7:20PM UTC
- Duration: 8 weeks
- Categories
- 4.0W/kg and OVER
- 3.2W/kg to 3.99W/kg
- 2.5W/kg to 3.19W/kg
- 2.49W/kg and UNDER
- Race Rules
- Categories are based on your best 30 day est. FTP (95% of 20min)
- Riders going over 5W/kg at 95% of 20 minute power will be removed from results.
- Riders going over 6W/kg for 5 minute power will be removed from results.
- Heart rate monitors advised to be worn by all participants.
- Only powermeter and smart trainer users eligible for official result placement.
- All bikes permitted.
- No powerups permitted.
- Official results located at https://boltrace.team/results/current/criterium-league.
- Points
- Points available depend on number of finishing riders; please refer to our
points table for full details.
- All participants finishing outside of the top 50 score 1 point.
- Points scoring applied to each category.
- Points Rules
- Points can only be earned in the correct category a participant races in.
- Racing in an incorrect category will void any points accrued.
- Points will not carry over when a rider changes category during a current league.
- Best 6 of 8 rounds count towards final standings.
- Mid-League Upgrades
- Riders going over category limits will be automatically upgraded in the official results.
- When a rider has been automatically upgraded, they are expected to race in their new
category for the remainder of the series.
League Standings
Previous Results
Current Standings
Last updated: {{ page.date | date: "%A, %B %e" }}
{% include standings.html riders=site.data.2021.series_3.criterium teams=site.data.2021.series_3.criteriumteam %}
{% include datetime.html %}


Statistical Weight
Wins:
0
Losses:
0
Win %:
0
%
Low Risk Bias
Wins:
0
Losses:
0
Win %:
0
%
Pathfinding
Wins:
0
Losses:
0
Win %:
0
%


What is grid based design?
Grid based design lets the developer envision the the html page in grid form which makes understanding the layout easy. Making changs to your layout is easier if the layout itself is easy to interpret.
What's all the hype about responsive web pages?
Depending upon the browser or display device used by the user the webpage needs to adjust accordingly. A responsive webpage's contents will not get distorted if the viewer shrinks the page. A responsive webpage retains its structure irrespective of the display device.
What is semantic structure?
Semantic structure determines the prominence of the content in a webpage. It allows the user to arrange important content first and then less important content after it and so on and so forth.
Points worth mentioning
Defining the layout does require a fair amount of guessing. It's best to draw it out on a piece of paper and try to replicate it from there.


Credits shall go to these papers and blog post which inspired me for this project:
import pickle
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
%matplotlib inline
kExplorationDir = 'exploration/'
kFolderName = 'C:/_HAF/sdc/behavioral-cloning/udacity_data'
kNumberOfImages = 6
images = np.ones((kNumberOfImages, 160, 320, 3), dtype=np.uint8)
plt.rcParams['figure.figsize'] = (12, 4)
for i in range(kNumberOfImages):
image = mpimg.imread(kExplorationDir + "raw%d.jpg" % i)
images[i] = image
plt.subplot(2, 3, i+1)
plt.imshow(image, aspect='auto')
plt.axis('off')
Hence we can crop the image at the top and bottom
kInputCols = 320
kInputRows = 160
kCropTop = 55
kCropBottom = kInputRows - 25
for i in range(kNumberOfImages):
image = images[i]
cropped_image = image[kCropTop:kCropBottom, :, :]
plt.subplot(2, 3, i+1)
plt.imshow(cropped_image, aspect='auto')
plt.axis('off')
The CSV file holds the references to the images and links those to the steering angle and even driving data such as speed and throttle.
import pandas as pd
data_frame = pd.read_csv('udacity_data/driving_log.csv')
data_frame.describe(include='all')
data_frame.hist(column='steering')
Hence the data set is very unbalanced towards small steering angles which can be problematic in strong curves. Also the bias of positive angles can be problematic.
The images can be flipped horizontally (and invert the corresponding steering angle), so that we can reduce the bias for turing left.
Possible solution orr #2 is to increase the number if images and steering angles where we detect a high degree of curvature, based on the actual input steering angle. By duplicating those detected images we get a slighty more balanced dataset.
kSteeringThresholds = [0.20, 0.40, 0.60]
kAddingFactor = 2
def add_curvy_images(input_data, thresholds):
abs_steering = np.abs(input_data['steering'])
for threshold in thresholds:
is_curve = abs_steering > threshold
curve_rows = input_data[is_curve]
for i in range(kAddingFactor):
input_data = input_data.append(curve_rows, ignore_index=False)
return input_data.reindex()
data_frame_added = add_curvy_images(data_frame, kSteeringThresholds)
data_frame_added.describe(include='all')
data_frame_added.hist(column='steering')
The udacity dataset provides multiple camera images, left, center and right.
from keras.preprocessing.image import img_to_array, load_img
for i, camera in enumerate(['left', 'center', 'right']):
image = load_img(kFolderName + '/' + data_frame.iloc[0][camera].strip())
image = img_to_array(image).astype(np.uint8)
plt.subplot(3, 3, i+1)
plt.imshow(image, aspect='auto')
plt.axis('off')
plt.title(camera)
We can incorporate the left and right camera images to simulate recovery, by adding or subtracting an artificial steering angle to the center steering value according to the direction.
Using left and right camera images to simulate the effect of car wandering off to the side, and recovering. We will add a small angle 0.25 to the left camera and subtract a small angle of 0.25 from the right camera. The main idea being the left camera has to move right to get to center, and right camera has to move left.
Since the dataset has a lot more images with the car turning left than right(because there are more left turns in the track), you can flip the image horizontally to simulate turing right and also reverse the corressponding steering angle.
In this you adjust the brightness of the image to simulate driving in different lighting conditions
By adding random shadows we can increase the number of augmented images to as many as we want. The idea behind the shadowing is that the network will be trained to detect the actual important edges of the street and no edges introduced by bad lightning conditons.
import cv2
kMinBrightness = 0.25
kSteeringAdjustments = 0.25
def alter_image_brightness(image):
# Convert to HSV space so that its easy to adjust brightness
altered_image = cv2.cvtColor(image, cv2.COLOR_RGB2HSV)
# Randomly generate the brightness reduction factor
# Add a constant so that it prevents the image from being completely dark
random_brightness = kMinBrightness + np.random.uniform()
# Apply the brightness reduction to the V channel
altered_image[:,:,2] = altered_image[:,:,2] * random_brightness
# Convert to RBG again
altered_image = cv2.cvtColor(altered_image, cv2.COLOR_HSV2RGB)
return altered_image
def flip_image(image):
return cv2.flip(image, 1)
def traverse_image(image):
# Translation in x direction
translation_x = kXRange * np.random.uniform() - kXRange / 2
# Changed steering angle based on x-direction
added_steering_angle = kAddedSteering + translation_x / kXRange * 2 * 0.2
# Translation in x direction
translation_y = kYRange * np.random.uniform() - kYRange / 2
# Apply the translation using warp method from opencv
translation_matrix = np.float32([[1, 0, translation_x], [0, 1, translation_y]])
translated_image = cv2.warpAffine(image, translation_matrix, (kInputCols, kInputRows))
return translated_image, added_steering_angle
row = data_frame.iloc[2500]
steering = row['steering']
image = load_img(kFolderName + '/' + row["center"].strip())
image = img_to_array(image).astype(np.uint8)
left = load_img(kFolderName + '/' + row["left"].strip())
left = img_to_array(left).astype(np.uint8)
plt.subplot(2,2,1)
plt.imshow(image, aspect='auto')
plt.axis('off')
plt.title("Center Camera, Steering %.2f" % steering)
plt.subplot(2,2,2)
plt.imshow(left, aspect='auto')
plt.axis('off')
plt.title("Left camera, Steering %.2f" % (steering + kSteeringAdjustments))
plt.subplot(2,2,3)
plt.imshow(flip_image(image), aspect='auto')
plt.axis('off')
plt.title("Flipped, Steering %.2f" % (-1.0 * steering))
plt.subplot(2,2,4)
plt.imshow(alter_image_brightness(image), aspect='auto')
plt.axis('off')
plt.title("Altered Brightness")
kMinBrightness = 0.25
kAddedSteering = 0.002
kXRange = 80
kYRange = 40
kInputCols = 320
kInputRows = 160
def traverse_image(image):
# Translation in x direction
translation_x = kXRange * np.random.uniform() - kXRange / 2
# Changed steering angle based on x-direction
added_steering_angle = kAddedSteering + translation_x / kXRange * 2 * 0.2
# Translation in x direction
translation_y = kYRange * np.random.uniform() - kYRange / 2
# Apply the translation using warp method from opencv
translation_matrix = np.float32([[1, 0, translation_x], [0, 1, translation_y]])
translated_image = cv2.warpAffine(image, translation_matrix, (kInputCols, kInputRows))
return translated_image, added_steering_angle
def add_shadow(image, mask):
top_y = kInputCols * np.random.uniform()
top_x = 0
botom_x = kInputRows
botom_y = kInputCols * np.random.uniform()
image = cv2.cvtColor(image, cv2.COLOR_RGB2HSV)
shadow_mask = 0 * image[:,:,1]
mesh_x = np.mgrid[0:image.shape[0], 0:image.shape[1]][0]
mesh_y = np.mgrid[0:image.shape[0], 0:image.shape[1]][1]
is_mask = ((mesh_x - top_x) * (botom_y - top_y) - (botom_x - top_x) * (mesh_y - top_y)) >= 0
shadow_mask[is_mask] = 1
random_brightness = kMinBrightness + np.random.uniform()
mask_on = shadow_mask == mask
image[:,:,2][mask_on] = image[:,:,2][mask_on] * random_brightness
image = cv2.cvtColor(image, cv2.COLOR_HSV2RGB)
return image
row = data_frame.iloc[7670]
steering = row['steering']
image = load_img(kFolderName + '/' + row["center"].strip())
image = img_to_array(image).astype(np.uint8)
plt.subplot(2,2,1)
plt.imshow(image, aspect='auto')
plt.axis('off')
plt.title("Center Camera Image, Steering %.2f" % steering)
image_traversed, steer_added = traverse_image(image)
plt.subplot(2,2,2)
plt.imshow(image_traversed, aspect='auto')
plt.axis('off')
plt.title("Traversed Image, Steering %.2f" % (steering + steer_added))
image_shadow_on = add_shadow(image, 1)
image_shadow_off = add_shadow(image, 0)
plt.subplot(2,2,3)
plt.imshow(image_shadow_on, aspect='auto')
plt.axis('off')
plt.title("Shadowed Image Dark")
plt.subplot(2,2,4)
plt.imshow(image_shadow_off, aspect='auto')
plt.axis('off')
plt.title("Shadowed Image Bright")


Web of Things Cloud
A collection of Web ontologies for semantic interoperability on the Web of Things
Search
Change SPARQL endpoint...
SPARQL Endpoint
OK
Cannot connect to SPARQL endpoint.
Have you changed the endpoint URI (default:
localhost
)?


Well, as you might already know, enduro provides a sweet admin ui. Control types are a way for you to tell enduro what value to expect. For example, there is a date control, which offer user an enhanced experience when a date is expected.
Currently these controls are available in enduro by default:
something: 'text is here'
Textfield is the default control.
something : {
something_else: ''
}
something : [
{ label: "first" },
{ label: "second" },
]
Array control allows to add and remove items
$image_type : 'image'
Nice, full-featured image uploading control will let you drag in, copy/paste or just browse for an image. Fully compatible with your choice of remote file storage(such as aws s3).
$resume_type : 'file'
Simple file uploading control that lets you drag and drop files.
$text_type : 'textarea'
Simply textarea to input longer blocks of text.
$value_type : 'slider'
Creates input slider that goes from 0 to 100 by default.
$color_type : 'colorpicker'
Standard browser's colorpicker that outputs hex color code.
$title_type : 'title'
Creates header out of the property's value. Property will be non-editable though
$published_on_type : 'date'
Creates datepicker.
$foo_time_type : 'time'
Creates time selection dropdown.


Bringing you all the necessary details and all the latest products from Samsung.
Our Samsung Products have a unique touch when it comes to Graphics.
We sell products that you will utilise with 100% durability and the experience will always be world class.
Our products are built with the latest firmware to support all mobile devices anywhere in the world.


Hi,
I'm Dan.
Software Engineer
Let's connect!
Remote collaboration
Project leadership
AWS | Azure cloud
Unity | C# (.NET) | VR
Node.js | express.js | socket.io
SQL | NoSQL


Inline link style
Inline link with icon
Inline link with icon
Large inline link
Large link with icon
Large link with icon
Link with icon
Link with icon


Node.js, Python
Knowledge is power, but sharing knowledge is progress
Read my thoughts and progress on programming... Read my thoughts and progress on programming... Read my thoughts and progress on programming... Read my thoughts and progress on programming...
Contact