Skip to content

Instantly share code, notes, and snippets.

View Jsevillamol's full-sized avatar

Jaime Sevilla Jsevillamol

View GitHub Profile
@Jsevillamol
Jsevillamol / Prueba ejercicio 9 c
Created February 10, 2016 15:38
Prueba ejercicio 9 c
<p>Sea <script id="MathJax-Element-10368" type="math/tex">f:\mathbb{Z}[t]\to \mathbb{Z}[\sqrt 3]</script>, <script id="MathJax-Element-10369" type="math/tex">p(x)\mapsto p(\sqrt 3)</script>.</p>
<p>Claramente <script id="MathJax-Element-10370" type="math/tex">f</script> es sobreyectiva. Veamos que <script id="MathJax-Element-10371" type="math/tex">ker(f)=(t^2-3)</script>.</p>
<p>Claramente la inclusión <script id="MathJax-Element-10372" type="math/tex">\supset</script> se da.</p>
<p>Ahora, sea <script id="MathJax-Element-10373" type="math/tex">p\in ker f</script>. Por pseudodivisión, <script id="MathJax-Element-10374" type="math/tex">p(t)=(t^2-3)q(x)+r(x)</script>, con <script id="MathJax-Element-10375" type="math/tex">deg(r)<2</script>, y por tanto <script id="MathJax-Element-10376" type="math/tex">p(\sqrt 3)=r(\sqrt 3)=a+b\sqrt 3=0</script>. Como la suma de dos números racionales ha de ser racional, y <script id="MathJax-Element-10377" type="math/tex">\sqrt 3</script> es irracional, no queda más remedio
<p>The intuition behind the proof of Lób’s theorem invokes the formalization of the following argument:</p>
<p>Let <script id="MathJax-Element-27" type="math/tex">S</script> stand for the sentence “If <script id="MathJax-Element-28" type="math/tex">S</script> is provable, then I am Santa Claus”.</p>
<p>As it is standard, when trying to prove a If…then theorem we can start by supposing the antecedent and checking that the consequent follows. But if <script id="MathJax-Element-29" type="math/tex">S</script> is provable, then we can chain its proof to an application of modus ponens of <script id="MathJax-Element-30" type="math/tex">S</script> to itself in order to get a proof of the consequent “I am Santa Claus”. If we suppose that finding a proof of a sentence implies that the sentence is true, then “I am Santa Claus” is true.</p>
<p>Thus we have supposed that <script id="MathJax-Element-31" type="math/tex">S</script> is provably true then it follows that “I am Santa Claus”, which is a proof of what <script
@Jsevillamol
Jsevillamol / kelly_criterion.py
Created April 11, 2018 17:03
Public bet between Kyle and Jaime
# -*- coding: utf-8 -*-
"""
Created on Mon Apr 9 15:48:18 2018
@author: jsevillamol
"""
# After the game, I get either $1000 or the value of C in dollars rounded to nearest cent
# You can ask the 3rd party to run the flip_n_times() function as many times as you want within the 2h
# If C overflows during the game, the game ends and I get $1000 dollars
@Jsevillamol
Jsevillamol / CNN_RNN.py
Created October 28, 2018 13:46
CNN RNN model with masking in Keras
# Create model
model = Sequential()
input_shape = (n_tel, img_w, img_h, n_channels)
# mask the inputs that correspond to padding
model.add(Masking(mask_value=0., input_shape=input_shape))
# Add CNN feature extractor
model.add(TimeDistributed(
Conv2D(
@Jsevillamol
Jsevillamol / ROI_pooling.py
Last active July 3, 2024 10:06
ROI Pooling Layer
import tensorflow as tf
from tensorflow.keras.layers import Layer
class ROIPoolingLayer(Layer):
""" Implements Region Of Interest Max Pooling
for channel-first images and relative bounding box coordinates
# Constructor parameters
pooled_height, pooled_width (int) --
specify height and width of layer outputs
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Oct 27 10:22:03 2018
@author: jsevillamol
"""
import yaml, argparse
from contextlib import redirect_stdout
# The data config section configures the data loader
data_config:
# file_list_fn: path to a txt file where each line is the absolute path
# to a .h5 file containing information from an event
file_list_fn: /data2/deeplearning/ctlearn/tests/prototype_files_class_balanced.txt
# channels: list of image-like features per image that will be loaded. Supports:
# image_charge: total charge received by pixel during the event
# peak_times: time in seconds when the peak of energy occured
# CAUTION: ctalearn assumes that image_charge is always the first channel
jsevillamol@jsevillamol-N551JK:~/Descargas/pgilinux-2019-194-x86-64$ sudo ./install
[sudo] password for jsevillamol:
Welcome to the PGI Linux installer!
You are installing PGI 2019 version 19.4 for Linux.
Please note that all Trademarks and Marks are the properties
of their respective owners.
Press enter to continue...
# Script to retrieve the characteristics of the available backends in IBM Quantum Experience
# by Jaime Sevilla, based on a script from Douglas T. McClure
# Importing standard Qiskit libraries and configuring account
from qiskit import QuantumCircuit, execute, Aer, IBMQ
from qiskit.compiler import transpile, assemble
from qiskit.tools.jupyter import *
from qiskit.visualization import *
# Loading your IBM Q account(s)
provider = IBMQ.load_account()
@Jsevillamol
Jsevillamol / gist:318564fd73081542434c3f2a75ffdd99
Last active May 23, 2020 11:25
DAG Testing population as a mediator of slave trade and long term prosperity
dag {
"Ethnic fractionalization" [pos="-0.656,0.548"]
"Historical population" [pos="-0.543,0.055"]
"Modern GPD per capita" [outcome,pos="0.182,0.314"]
"Population growth" [pos="-0.362,0.631"]
"Slave trade intensity" [exposure,pos="-0.886,0.266"]
"Spatial autocorrelation" [pos="-0.174,0.071"]
"State development" [pos="-0.033,0.566"]
"Ethnic fractionalization" -> "Modern GPD per capita"
"Historical population" -> "Ethnic fractionalization"