This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <assert.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdint.h> | |
#include <string.h> | |
#include <math.h> | |
#include <sys/mman.h> | |
#include <stdbool.h> | |
#include "cJSON.h" | |
#define VOCABULARY_SIZE 50257 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <assert.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdint.h> | |
#include <string.h> | |
#include <sys/mman.h> | |
#include "cJSON.h" | |
#define VOCABULARY_SIZE 50257 | |
#define tf_d_vocab 50257 | |
#define tf_d_seq 1024 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <math.h> | |
#include <stdlib.h> | |
#include <assert.h> | |
#define PI 3.14159265358979323846 | |
#define MIN_BETA 0.0001 | |
#define MAX_BETA 0.9999 | |
float DiffusionInternalSigmoid(float x) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <math.h> | |
#include <stdlib.h> | |
#include <assert.h> | |
#define PI 3.14159265358979323846 | |
#define MIN_BETA 0.0001 | |
#define MAX_BETA 0.9999 | |
float DiffusionInternalSigmoid(float x) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef _FFASM_H_ | |
#define _FFASM_H_ | |
#ifndef ff_BITS | |
#define ff_BITS 32 | |
#endif | |
#include <stdarg.h> | |
#include <stdint.h> | |
#include <stdio.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Online C compiler to run C program online | |
#include <stdio.h> | |
#include <stdint.h> | |
typedef int64_t fixedpt; | |
#define FIXEDPT_BITS 32 | |
#define FIXEDPT_WBITS 24 | |
#define FIXEDPT_FBITS (FIXEDPT_BITS - FIXEDPT_WBITS) | |
#define FIXEDPT_ONE ((fixedpt)((fixedpt)1 << FIXEDPT_FBITS)) | |
#define fixedpt_rconst(R) ((fixedpt)((R) * FIXEDPT_ONE + ((R) >= 0 ? 0.5 : -0.5))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Code from this Murage Kibicho answer on Stack Exchange : https://math.stackexchange.com/questions/3260673/primes-having-2-as-a-primitive-root/5041497#5041497 | |
#include <stdio.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <math.h> | |
#define TRUE 1 | |
#define FALSE 0 | |
int ModularExponentiation(int base, int exp, int mod) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <math.h> | |
// Function to compute (base^exp) % mod using fast modular exponentiation | |
long long mod_exp(long long base, long long exp, long long mod) { | |
long long result = 1; | |
while (exp > 0) { | |
if (exp % 2 == 1) result = (result * base) % mod; | |
base = (base * base) % mod; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <math.h> | |
#include <assert.h> | |
typedef struct blankinship_row_struct *BlankinshipRow; | |
typedef BlankinshipRow* BlankinshipMatrix; | |
struct blankinship_row_struct | |
{ | |
int leader; | |
int numberOfColumns; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <math.h> | |
#include <assert.h> | |
#include <gmp.h> | |
//Run command : clear && gcc BlankinshipGMP.c -lgmp -lm -o m.o && ./m.o | |
typedef struct blankinship_row_struct *BlankinshipRow; | |
typedef BlankinshipRow* BlankinshipMatrix; | |
struct blankinship_row_struct |