rec-4-12-2018
Artificial Intelligence
Resolution
If , then:
If there is a empty clause after a resolution, it means there are conflicts.
Resolution algorithm to prove within KB:
- Generate CNF of the knowledge base
- CNF:
- Also called k-CNF if
- Repeat resolution process for every new rule
- If there is no new rule, cannot be proved.
- If there is an empty literal, then stop and is proved
Complexity: exponential
Expressiveness: better (not restricted to Horn clauses)
Propositional logic
Jargons
Use functions, predicates to represent relationships:
- A is a person -> , Person: predicate
- Person a has a crippled left leg -> , LeftLegOf: function (it’s OK since a human has only one left leg) Formally,
Term ::= Function ( Term {, Term}* ) AtomicSentence ::= predicate ( Term {, Term}* ) …
Model
Forgot that.
Networking
Cisco’s proprietary software, packettracer
, couldn’t be downloaded without enrolling in its network course.
IOS
- use
enable
to enable the thing show interfaces
to have a look at all interfaces,show interface [interface]
.show vlan
to show vlanconfigure terminal
to open the configuration in terminal(config) interface [interface]
to select an interface
Dynamic Trunking Protocol
A proprietary protocol invented by Cisco to negotiate trunking on a link between two VLAN-aware switches.
There is several modes for it:
access
: puts the ethernet port into non-trunking mode and negotiates to convert the link to a nontrunk one, disregarding the neigboring porttrunk
: puts the ethernet port into trunking mode and negotiates to convert the link to a trunk one, disregarding the neigboring portdynamic auto
: willing to trunk, will be trunk if the neighboring port isdynamic desirable
ortrunk
dynamic desirable
: actively willing to trunknonegotiate
: disable DTP. No wonder, it is not compatible withdynamic
modes.
Except nonegotiate
, all modes are triggered by (config-if) switchport mode [mode]
. Switch to no-negotiate mode using (config-if) switchport nonegotiate
.
Use a no
before the statement to do the opposite thing, like:
(config-if) no shutdown
: set up the link
(config-if) no switchport nonegotiate
: turn on DTP
Computer Graphics
Blurring is often used in computer graphics, like, to create HDR(high dynamic range) bloom, depth of field or other post process effects.
HDR bloom: since the real-world camera cannot focus perfectly, so it will convolve the incoming image with an Airy disk. What about the Airy disk? Know what a spot of light looks like in our eyes? That would be one. A perfect lens with a circular aperture would make it because the diffraction of light.
This effect is not noticeable when it is not so bright. However, with more light we can see the blurred edge of the bright part of the image, taken by a camera. And computer graphics tries to reproduce the same effect by blurring.
You can think up an approach instantly: take the average of neighboring blocks, like below:
By all means this is bad. It will seem block-ish.
A better one is Gaussian blur. It uses the Gaussian distribution as the weight of neighboring pixels to calculate the average, or more accurately, do the convolution. The weight matrix, like the one above, is called kernel.
A 3x3 Gaussian kernel is like:
Some other kernels are here.
It also can be used before downsampling: Gaussian blur gets rid of the sharp edges in the image, thus after downsampling, it will free the image from aliasing like moire patterns. Aliasing happens because of the poor sampling makes different signals indistinguishable, and some high frequency signals might get in the way after sampling. So a low pass filter need to be applied before sampling.
Task: sample => downscale image Reason of problem: high freq. signal => ? Problem: aliasing => moire pattern Solution: low pass filter => blurring
And yes, Gaussian blur is also a low pass filter, with a Bode plot like a parabola. Possibly it seems obvious at first sight: Gaussian distribution has a factor , which is stable through Fourier transforms.
We can calculate it out. Let’s put the basic calculus into practice.
So the amplification is:
Perfect! It is a parabola after all.
Leave Kawase to the next day.
Misc
マシンガンでも壊せなくて キャタピラーでも潰せなくて