100% found this document useful (3 votes)
27 views

Practical Machine Learning With R And Python Machine Learning In Stereo Tinniam V Ganesh download

The document discusses various practical machine learning resources, particularly focusing on the book 'Practical Machine Learning With R And Python' by Tinniam V Ganesh. It provides a comprehensive overview of deep learning concepts, including implementations in Python, R, and Octave, and covers topics such as logistic regression, neural networks, and gradient descent optimization techniques. Additionally, it emphasizes the importance of understanding deep learning by building networks from scratch and includes various appendices for further reference.

Uploaded by

sigelrivke6c
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (3 votes)
27 views

Practical Machine Learning With R And Python Machine Learning In Stereo Tinniam V Ganesh download

The document discusses various practical machine learning resources, particularly focusing on the book 'Practical Machine Learning With R And Python' by Tinniam V Ganesh. It provides a comprehensive overview of deep learning concepts, including implementations in Python, R, and Octave, and covers topics such as logistic regression, neural networks, and gradient descent optimization techniques. Additionally, it emphasizes the importance of understanding deep learning by building networks from scratch and includes various appendices for further reference.

Uploaded by

sigelrivke6c
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 80

Practical Machine Learning With R And Python

Machine Learning In Stereo Tinniam V Ganesh


download

https://ebookbell.com/product/practical-machine-learning-with-r-
and-python-machine-learning-in-stereo-tinniam-v-ganesh-11116082

Explore and download more ebooks at ebookbell.com


Here are some recommended products that we believe you will be
interested in. You can click the link to download.

Practical Machine Learning With R Tutorials And Case Studies Carsten


Lange

https://ebookbell.com/product/practical-machine-learning-with-r-
tutorials-and-case-studies-carsten-lange-56923656

Hyperparameter Tuning For Machine And Deep Learning With R A Practical


Guide 1st Ed 2023 Eva Bartz

https://ebookbell.com/product/hyperparameter-tuning-for-machine-and-
deep-learning-with-r-a-practical-guide-1st-ed-2023-eva-bartz-48885888

Practical Machine Learning With Lightgbm And Python Andrich Van Wyk

https://ebookbell.com/product/practical-machine-learning-with-
lightgbm-and-python-andrich-van-wyk-55883900

Practical Machine Learning With Aws Process Build Deploy And


Productionize Your Models Using Aws 1st Ed Himanshu Singh

https://ebookbell.com/product/practical-machine-learning-with-aws-
process-build-deploy-and-productionize-your-models-using-aws-1st-ed-
himanshu-singh-22417530
Practical Machine Learning With Spark Uncover Apache Sparks Scalable
Performance With Highquality Algorithms Gourav Gupta

https://ebookbell.com/product/practical-machine-learning-with-spark-
uncover-apache-sparks-scalable-performance-with-highquality-
algorithms-gourav-gupta-43743952

Practical Machine Learning With H2o Powerful Scalable Techniques For


Deep Learning And Ai 1st Edition Darren Cook

https://ebookbell.com/product/practical-machine-learning-
with-h2o-powerful-scalable-techniques-for-deep-learning-and-ai-1st-
edition-darren-cook-5733694

Practical Machine Learning With Python Dipanjan Sarkar Raghav Bali

https://ebookbell.com/product/practical-machine-learning-with-python-
dipanjan-sarkar-raghav-bali-6808286

Practical Machine Learning With Python A Problemsolvers Guide To


Building Realworld Intelligent Systems Dipanjan Sarkar

https://ebookbell.com/product/practical-machine-learning-with-python-
a-problemsolvers-guide-to-building-realworld-intelligent-systems-
dipanjan-sarkar-6827816

Practical Machine Learning With Rust Creating Intelligent Applications


In Rust Joydeep Bhattacharjee

https://ebookbell.com/product/practical-machine-learning-with-rust-
creating-intelligent-applications-in-rust-joydeep-
bhattacharjee-10608512
Deep Learning from first principles –
Second Edition
In vectorized Python, R and Octave
This book is dedicated to the memory of my late Mom and Dad who
continue to be the force behind all my actions
This book is also dedicated to my wife Shanthi for her support and for
giving me the space to work, and finally to my daughter, Shreya, for
bringing joy to my life.
Table of Contents
Preface
Introduction
1. Logistic Regression as a Neural Network
2. Implementing a simple Neural Network
3. Building a L- Layer Deep Learning Network
4. Deep Learning network with the Softmax
5. MNIST classification with Softmax
6. Initialization, regularization in Deep Learning
7. Gradient Descent Optimization techniques
8. Gradient Check in Deep Learning
1. Appendix A
2. Appendix 1 – Logistic Regression as a Neural Network
3. Appendix 2 - Implementing a simple Neural Network
4. Appendix 3 - Building a L- Layer Deep Learning Network
5. Appendix 4 - Deep Learning network with the Softmax
6. Appendix 5 - MNIST classification with Softmax
7. Appendix 6 - Initialization, regularization in Deep Learning
8. Appendix 7 - Gradient Descent Optimization techniques
9. Appendix 8 – Gradient Check
References
Preface
You don’t understand anything until you learn it more than one
way. Marvin Minsky
The last decade and some, has witnessed some remarkable
advancements in the area of Deep Learning. This area of AI has
proliferated into many branches - Deep Belief Networks, Recurrent
Neural Networks, Convolution Neural Networks, Adversorial
Networks, Reinforcement Learning, Capsule Networks and the list
goes on. These years have also resulted in Deep Learning to move
from the research labs and closer to the home, thanks to progress in
hardware, strorage and cloud technology.
One common theme when you listen to Deep Learning pundits, is that
in order to get a good grasp of the Deep Learning domain, it is
essential that you learn to build such a network from scratch. It is
towards that end that this book was written.
In this book, I implement Deep Learning Networks from the basics.
Each successive chapter builds upon the implementations of the
previous chapters so that by chapter 7, I have a full-fledged, generic
L-Layer Deep Learning network, with all the bells and whistles. All
the necessary derivations required for implementing a multi-layer
Deep Learning network is included in the chapters. Detailed
derivations for forward propagation and backward propagation cycles
with relu, tanh and sigmoid hidden layer units, and sigmoid and
softmax output activation units are included. These may serve to jog
your memory of all those whose undergrad calculus is a little rusty.
The first chapter derives and implements logisitic regression as a
neural network in Python, R and Octave. The second chapter deals
with the derivation and implementation of the most primitive neural
network, one with just one hidden layer. The third chapter extends on
the principles of the 2nd chapter and implements a L-Layer Deep
Learning network with the sigmoid activation in vectorized Python, R
and Octave. This implementation can include an arbitrary number of
hidden units and any number of hidden layers for the sigmoid
activation output layer. The fourth chapter introduces the Softmax
function required for multi-class classification. The Jacobian of the
Softmax and cross-entropy loss is derived and then this implemented
to demonstrate multi-class classification of a simple spiral data set.
The fifth chapter incorporates the softmax implementation of the
fourth chapter into the L-Layer implementation in the 3rd chapter.
With this enhancement, the fifth chapter classifies MNIST digits using
Softmax output activation unit in a generic L-Layer implementation.
The sixth chapter addresses different initialization techniques like He
and Xavier. Further, this chapter also discusses and implements L2
regularization and random dropout technique. The seventh chapter
looks at gradient descent optimization techniques like learning rate
decay, momentum, rmsprop, and adam. The eight chapter discusses a
critical technique, that is required to ensure the correctness of the
backward propagation implementation. Specifically this chapter
discusses and implements ‘gradient checking’ and also demonstrates
how to find bugs in your implementation.
All the chapters include vectorized implementations in Python, R and
Octave. The implementations are identical. So, if your are conversant
in any one of the languages you can look at the implementations in
any other language. It should be a good way to learn the other
language.
Note: The functions that are invoked in each of the chapters are
included in Appendix 1-Appendix 8.
Feel free to check out the implementations by playing around with the
hyper-parameters. A good way to learn is to take the code apart. You
could also try to enhance the implementation to include other
activation functions like the leaky relu, parametric relu etc. Maybe,
you could work on other regularization or gradient descent
optimization methods. There may also be opportunities to optimize
my code with further vectorization of functions.
This course is largely based on Prof Andrew Ng’s Deep Learning
Specialization (https://www.coursera.org/specializations/deep-
learning).
I would like to thank Prof Andrew Ng and Prof Geoffrey Hinton for
making the apparent complexity of the Deep Learning subject into
remarkably simple concepts through their courses.
I hope this book sets you off on a exciting and challenging journey
into the Deep Learning domain

Tinniam V Ganesh
16 May 2018
Introduction
This is the second edition of my book ‘Deep Learning from first
principles: Second Edition – In vectorized Python, R and Octave’.
Since this book has about 70% code, I wanted to make the code more
readable. Hence, in this second edition, I have changed all the code to
use the fixed-width font Lucida Console. This makes the code more
organized and can be more easily absorbed. I have also included line
numbers for all functions and code snippets. Finally, I have corrected
some of the typos in the book.
Other books by the author (available on Amazon in paperback and
kindle versions)
1. Practical Machine Learning with R and Python: Second Edition
– Machine Learning in stereo
2. Beaten by sheer pace: Third Edition – Cricket analytics with
yorkr
3. Cricket analytics with cricketr:Third Edition
1. Logistic Regression as a Neural
Network
“You don’t perceive objects as they are. You perceive them as you
are.”
“Your interpretation of physical objects has everything to do with the
historical trajectory of your brain – and little to do with the objects
themselves.”
“The brain generates its own reality, even before it receives
information coming in from the eyes and the other senses. This is
known as the internal model”
David Eagleman - The Brain: The Story of You

This chapter deals with the implementation of Logistic regression as a


2-layer Neural Network i.e. a Neural Network that just has an input
layer and an output layer and with no hidden layer. This 2-layer
network is implemented in Python, R and Octave languages. I have
included Octave, into the mix, as Octave is a close cousin of Matlab.
These implementations in Python, R and Octave are equivalent
vectorized implementations. Therefore, if you are familiar in any one
of the languages, you should be able to look at the corresponding code
in the other two. The implementations of the functions invoked in this
chapter are in Appendix 1 – Logistic Regression as a Neural Network.

You can also clone/download the vectorized code in Pythin, R and


Octave from Github at DeepLearningFromFirstPrinciples
’(https://github.com/tvganesh/DeepLearningFromFirstPrinciples/tree/master/Chap
LogisticRegressionAsNeuralNetwork). To start with, Logistic
Regression is performed using sklearn’s logistic regression package,
for the cancer data set also from sklearn. This is shown below
1.Logistic Regression
import numpy as np
import pandas as pd
import os
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LogisticRegression
from sklearn.datasets import make_classification, make_blobs

from sklearn.metrics import confusion_matrix


from matplotlib.colors import ListedColormap
from sklearn.datasets import load_breast_cancer

# Load the cancer data


(X_cancer, y_cancer) = load_breast_cancer(return_X_y = True)
X_train, X_test, y_train, y_test = train_test_split(X_cancer, y_cancer,
random_state = 0)

# Call the Logisitic Regression function


clf = LogisticRegression().fit(X_train, y_train)

#Print accuracy of training and test set


print('Accuracy of Logistic regression classifier on training set: {:.2f}'
.format(clf.score(X_train, y_train)))
print('Accuracy of Logistic regression classifier on test set: {:.2f}'
.format(clf.score(X_test, y_test)))
## Accuracy of Logistic regression classifier on training set: 0.96
## Accuracy of Logistic regression classifier on test set: 0.96
2.Logistic Regression as a 2-layer Neural
Network
In the following section, Logistic Regression is implemented as a 2-
layer Neural Network in Python, R and Octave. The same cancer data
set from sklearn is used to train and test the Neural Network in
Python, R and Octave. This can be represented diagrammatically as
below

The cancer data set has 30 input features, and the target variable
‘output’ is either 0 or 1. Hence, the sigmoid activation function will be
used in the output layer for classification.

This simple 2-layer Neural Network is shown below.


At the input layer, there are 30 features and the corresponding weights
of these inputs which are initialized to small random values.

where ‘b’ is the bias term


The Activation function is the sigmoid function which is given by

The Loss, when the sigmoid function is used in the output layer, is
given by
(1)
3.Gradient Descent
3.1 Forward propagation
The forward propagation cycle of the Neural Network computes the
output Z and the activation the sigmoid activation function. Then
using the output ‘y’ for the given features, the ‘Loss’ is computed
using equation (1) above.

3.2 Backward propagation


The backward propagation cycle determines how the ‘Loss’ is
impacted for small variations from the previous layers up to the input
layer. In other words, backward propagation computes the changes in
the weights at the input layer, which will minimize the loss at the
output layer. Several cycles of gradient descent are performed in the
path of steepest descent to find the local minima. In other words, the
set of weights and biases, at the input layer, which will result in the
lowest loss, is computed by gradient descent. The weights at the input
layer are decreased by a parameter known as the ‘learning rate’. Too
big a ‘learning rate’ can overshoot the local minima, and too small a
‘learning rate’ can take a long time to reach the local minima.
Gradient Descent iterated through this forward propagation and
backward propagation cycle until the loss is minimized. This is done
for ‘m’ training examples.

3.3Chain rule of differentiation


Let y=f(u)
and u=g(x) then by chain rule

3.4Derivative of sigmoid

Let then
and

Using the chain rule of differentiation we get

Therefore -(2)
The 3 equations for the 2 layer Neural Network representation of
Logistic Regression are
-(a)
-(b)
-
(c)
Where L is the loss for the sigmoid output activation function

The back-propagation step requires the computation of and


. In the case of regression it would be and
where dE is the Mean Squared Error function.

Computing the derivatives for the Loss function we have


-(d)
because
Also from equation (2) we can write
– (e)

By chain rule

therefore substituting the results of (d) & (e) into the equation above
we get
(f)

Finally
-(g)
– (h)
and from (f) we have
Therefore (g) reduces to
-(i)

Also
-(j)
Since
and using (f) in (j) we get

The gradient computes the weights at the input layer and the
corresponding bias by using the values
of and

The computation graph representation in the book Deep Learning


(http://www.deeplearningbook.org/) : Ian Goodfellow, Yoshua
Bengio, Aaron Courville, is very useful to visualize and compute the
backward propagation. For the 2-layer Neural Network of Logistic
Regression the computation graph is shown below
4. Neural Network for Logistic
Regression -Python code
import numpy as np
import pandas as pd
import os
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split

# Define the sigmoid function


def sigmoid(z):
a=1/(1+np.exp(-z))
return a

# Initialize weights and biases


def initialize(dim):
w = np.zeros(dim).reshape(dim,1)
b=0
return w

# Compute the loss


def computeLoss(numTraining,Y,A):
loss=-1/numTraining *np.sum(Y*np.log(A) + (1-Y)*(np.log(1-A)))
return(loss)

# Execute the forward propagation


def forwardPropagation(w,b,X,Y):
# Compute Z
Z=np.dot(w.T,X)+b
# Determine the number of training samples
numTraining=float(len(X))
# Compute the output of the sigmoid activation function
A=sigmoid(Z)
#Compute the loss
loss = computeLoss(numTraining,Y,A)
# Compute the gradients dZ, dw and db
dZ=A-Y
dw=1/numTraining*np.dot(X,dZ.T)
db=1/numTraining*np.sum(dZ)

# Return the results as a dictionary


gradients = {"dw": dw,
"db": db}
loss = np.squeeze(loss)
return gradients,loss

# Compute Gradient Descent


def gradientDescent(w, b, X, Y, numIerations, learningRate):
losses=[]
idx =[]
# Iterate
for i in range(numIerations):
gradients,loss=forwardPropagation(w,b,X,Y)
#Get the derivates
dw = gradients["dw"]
db = gradients["db"]
w = w-learningRate*dw
b = b-learningRate*db

# Store the loss


if i % 100 == 0:
idx.append(i)
losses.append(loss)
# Set params and grads
params = {"w": w,
"b": b}
grads = {"dw": dw,
"db": db}

return params, grads, losses,idx

# Predict the output for a training set


def predict(w,b,X):
size=X.shape[1]
yPredicted=np.zeros((1,size))
Z=np.dot(w.T,X)
# Compute the sigmoid
A=sigmoid(Z)
for i in range(A.shape[1]):
#If the value is > 0.5 then set as 1
if(A[0][i] > 0.5):
yPredicted[0][i]=1
else:
# Else set as 0
yPredicted[0][i]=0

return yPredicted

#Normalize the data


def normalize(x):
x_norm = None
x_norm = np.linalg.norm(x,axis=1,keepdims=True)
x= x/x_norm
return x

# Run the 2-layer Neural Network on the cancer data set


from sklearn.datasets import load_breast_cancer
# Load the cancer data
(X_cancer, y_cancer) = load_breast_cancer(return_X_y = True)
# Create train and test sets
X_train, X_test, y_train, y_test = train_test_split(X_cancer, y_cancer,
random_state = 0)
# Normalize the data for better performance
X_train1=normalize(X_train)

# Create weight vectors of zeros. The size is the number of features in the data
set=30
w=np.zeros((X_train.shape[1],1))
#w=np.zeros((30,1))
b=0

#Normalize the training data so that gradient descent performs better


X_train1=normalize(X_train)
#Transpose X_train so that we have a matrix as (features, numSamples)
X_train2=X_train1.T

# Reshape to remove the rank 1 array and then transpose


y_train1=y_train.reshape(len(y_train),1)
y_train2=y_train1.T

# Run gradient descent for 4000 times and compute the weights
parameters, grads, costs,idx = gradientDescent(w, b, X_train2, y_train2,
numIerations=4000, learningRate=0.75)
w = parameters["w"]
b = parameters["b"]

# Normalize X_test
X_test1=normalize(X_test)
#Transpose X_train so that we have a matrix as (features, numSamples)
X_test2=X_test1.T

#Reshape y_test
y_test1=y_test.reshape(len(y_test),1)
y_test2=y_test1.T

# Predict the values for


yPredictionTest = predict(w, b, X_test2)
yPredictionTrain = predict(w, b, X_train2)

# Print the accuracy


print("train accuracy: {} %".format(100 - np.mean(np.abs(yPredictionTrain -
y_train2)) * 100))
print("test accuracy: {} %".format(100 - np.mean(np.abs(yPredictionTest -
y_test)) * 100))

# Plot the Costs vs the number of iterations


fig1=plt.plot(idx,costs)
fig1=plt.title("Gradient descent-Cost vs No of iterations")
fig1=plt.xlabel("No of iterations")
fig1=plt.ylabel("Cost")
fig1.figure.savefig("fig1", bbox_inches='tight')
## train accuracy: 90.3755868545 %
## test accuracy: 89.5104895105 %

Note: The Accuracy on the training and test set is 90.37% and
89.51%. This is comparatively poorer than the 96%, which the logistic
regression of sklearn achieves! But, this is mainly because of the
absence of hidden layers which is the real power of neural networks .
5. Neural Network for Logistic
Regression -R code
source("RFunctions-1.R")
# Define the sigmoid function
sigmoid <- function(z){
a <- 1/(1+ exp(-z))
a
}

# Compute the loss


computeLoss <- function(numTraining,Y,A){
loss <- -1/numTraining* sum(Y*log(A) + (1-Y)*log(1-A))
return(loss)
}

# Compute forward propagation


forwardPropagation <- function(w,b,X,Y){
# Compute Z
Z <- t(w) %*% X +b
#Set the number of samples
numTraining <- ncol(X)
# Compute the activation function
A=sigmoid(Z)

#Compute the loss


loss <- computeLoss(numTraining,Y,A)

# Compute the gradients dZ, dw and db


dZ<-A-Y
dw<-1/numTraining * X %*% t(dZ)
db<-1/numTraining*sum(dZ)

fwdProp <- list("loss" = loss, "dw" = dw, "db" = db)


return(fwdProp)
}
# Perform one cycle of Gradient descent
gradientDescent <- function(w, b, X, Y, numIerations, learningRate){
losses <- NULL
idx <- NULL
# Loop through the number of iterations
for(i in 1:numIerations){
fwdProp <-forwardPropagation(w,b,X,Y)
#Get the derivatives
dw <- fwdProp$dw
db <- fwdProp$db
#Perform gradient descent
w = w-learningRate*dw
b = b-learningRate*db
l <- fwdProp$loss
# Stoe the loss
if(i %% 100 == 0){
idx <- c(idx,i)
losses <- c(losses,l)
}
}

# Return the weights and losses


gradDescnt <-
list("w"=w,"b"=b,"dw"=dw,"db"=db,"losses"=losses,"idx"=idx)
return(gradDescnt)
}

# Compute the predicted value for input


predict <- function(w,b,X){
m=dim(X)[2]
# Create a ector of 0's
yPredicted=matrix(rep(0,m),nrow=1,ncol=m)
Z <- t(w) %*% X +b
# Compute sigmoid
A=sigmoid(Z)
for(i in 1:dim(A)[2]){
# If A > 0.5 set value as 1
if(A[1,i] > 0.5)
yPredicted[1,i]=1
else
# Else set as 0
yPredicted[1,i]=0
}

return(yPredicted)
}

# Normalize the matrix


normalize <- function(x){
#Create the norm of the matrix.Perform the Frobenius norm of the matrix
n<-as.matrix(sqrt(rowSums(x^2)))
#Sweep by rows by norm. Note '1' in the function which performing on every
row
normalized<-sweep(x, 1, n, FUN="/")
return(normalized)
}

# Run the 2 layer Neural Network on the cancer data set


# Read the data (from sklearn)
cancer <- read.csv("cancer.csv")
# Rename the target variable
names(cancer) <- c(seq(1,30),"output")
# Split as training and test sets
train_idx <- trainTestSplit(cancer,trainPercent=75,seed=5)
train <- cancer[train_idx, ]
test <- cancer[-train_idx, ]

# Set the features


X_train <-train[,1:30]
y_train <- train[,31]
X_test <- test[,1:30]
y_test <- test[,31]
# Create a matrix of 0's with the number of features
w <-matrix(rep(0,dim(X_train)[2]))
b <-0
X_train1 <- normalize(X_train)
X_train2=t(X_train1)
# Reshape then transpose
y_train1=as.matrix(y_train)
y_train2=t(y_train1)

# Perform gradient descent


gradDescent= gradientDescent(w, b, X_train2, y_train2, numIerations=3000,
learningRate=0.77)
# Normalize X_test
X_test1=normalize(X_test)
#Transpose X_train so that we have a matrix as (features, numSamples)
X_test2=t(X_test1)

#Reshape y_test and take transpose


y_test1=as.matrix(y_test)
y_test2=t(y_test1)

# Use the values of the weights generated from Gradient Descent


yPredictionTest = predict(gradDescent$w, gradDescent$b, X_test2)
yPredictionTrain = predict(gradDescent$w, gradDescent$b, X_train2)

sprintf("Train accuracy: %f",(100 - mean(abs(yPredictionTrain - y_train2)) *


100))
## [1] "Train accuracy: 90.845070"
sprintf("test accuracy: %f",(100 - mean(abs(yPredictionTest - y_test)) * 100))
## [1] "test accuracy: 87.323944"
df <-data.frame(gradDescent$idx, gradDescent$losses)
names(df) <- c("iterations","losses")
ggplot(df,aes(x=iterations,y=losses)) + geom_point() + geom_line(col="blue") +
ggtitle("Gradient Descent - Losses vs No of Iterations") +
xlab("No of iterations") + ylab("Losses")
6.Neural Network for Logistic
Regression -Octave code
1;
# Define sigmoid function
function a = sigmoid(z)
a = 1 ./ (1+ exp(-z));
end

# Compute the loss


function loss=computeLoss(numtraining,Y,A)
loss = -1/numtraining * sum((Y .* log(A)) + (1-Y) .* log(1-A));
end

# Perform forward propagation


function [loss,dw,db,dZ] = forwardPropagation(w,b,X,Y)
# Compute Z
Z = w' * X + b;
numtraining = size(X)(1,2);
# Compute sigmoid
A = sigmoid(Z);
#Compute loss. Note this is element wise product
loss =computeLoss(numtraining,Y,A);
# Compute the gradients dZ, dw and db
dZ = A-Y;
dw = 1/numtraining* X * dZ';
db =1/numtraining*sum(dZ);
end

# Compute Gradient Descent


function [w,b,dw,db,losses,index]=gradientDescent(w, b, X, Y, numIerations,
learningRate)
#Initialize losses and idx
losses=[];
index=[];
# Loop through the number of iterations
for i=1:numIerations,
[loss,dw,db,dZ] = forwardPropagation(w,b,X,Y);
# Perform Gradient descent
w = w - learningRate*dw;
b = b - learningRate*db;
if(mod(i,100) ==0)
# Append index and loss
index = [index i];
losses = [losses loss];
endif
end
end

# Determine the predicted value for dataset


function yPredicted = predict(w,b,X)
m = size(X)(1,2);
yPredicted=zeros(1,m);
# Compute Z
Z = w' * X + b;
# Compute sigmoid
A = sigmoid(Z);
for i=1:size(X)(1,2),
# Set predicted as 1 if A > 0,5
if(A(1,i) >= 0.5)
yPredicted(1,i)=1;
else
yPredicted(1,i)=0;
endif
end
end

# Normalize by dividing each value by the sum of squares


function normalized = normalize(x)
# Compute Frobenius norm. Square the elements, sum rows and then find
square root
a = sqrt(sum(x .^ 2,2));
# Perform element wise division
normalized = x ./ a;
end
# Split into train and test sets
function [X_train,y_train,X_test,y_test] = trainTestSplit(dataset,trainPercent)
# Create a random index
ix = randperm(length(dataset));
# Split into training
trainSize = floor(trainPercent/100 * length(dataset));
train=dataset(ix(1:trainSize),:);
# And test
test=dataset(ix(trainSize+1:length(dataset)),:);
X_train = train(:,1:30);
y_train = train(:,31);
X_test = test(:,1:30);
y_test = test(:,31);
end

# Read the data


cancer=csvread("cancer.csv");

# Split as train and test


[X_train,y_train,X_test,y_test] = trainTestSplit(cancer,75);

#Initialize w and b
w=zeros(size(X_train)(1,2),1);
b=0;

#Normalize training
X_train1=normalize(X_train);
X_train2=X_train1';
y_train1=y_train';

#Perform gradient descent


[w1,b1,dw,db,losses,idx]=gradientDescent(w, b, X_train2, y_train1,
numIerations=3000, learningRate=0.75);

# Normalize X_test
X_test1=normalize(X_test);
#Transpose X_train so that we have a matrix as (features, numSamples)
X_test2=X_test1';
y_test1=y_test';
# Use the values of the weights generated from Gradient Descent
yPredictionTest = predict(w1, b1, X_test2);
yPredictionTrain = predict(w1, b1, X_train2);

#Compute Accouracy
trainAccuracy=100-mean(abs(yPredictionTrain - y_train1))*100
testAccuracy=100- mean(abs(yPredictionTest - y_test1))*100
trainAccuracy = 90.845
testAccuracy = 89.510

graphics_toolkit('gnuplot')
plot(idx,losses);
title ('Gradient descent- Cost vs No of iterations');
xlabel ("No of iterations");
ylabel ("Cost");

Conclusion
This chapter starts with a simple 2-layer Neural Network
implementation of Logistic Regression. Clearly, the performance of
this simple Neural Network is comparatively poor to the highly
optimized sklearn’s Logistic Regression. This is because the above
neural network did not have any hidden layers. Deep Learning &
Neural Networks achieve extraordinary performance because of the
presence of deep hidden layers
2. Implementing a simple Neural
Network
“What does the world outside your head really ‘look’ like? Not only is
there no color, there’s also no sound: the compression and expansion
of air is picked up by the ears and turned into electrical signals. The
brain then presents these signals to us as mellifluous tones and
swishes and clatters and jangles. Reality is also odorless: there’s no
such thing as smell outside our brains. Molecules floating through the
air bind to receptors in our nose and are interpreted as different
smells by our brain. The real world is not full of rich sensory events;
instead, our brains light up the world with their own sensuality.”
The Brain: The Story of You” by David Eagleman

“The world is Maya, illusory. The ultimate reality, the Brahman, is all-
pervading and all-permeating, which is colourless, odourless,
tasteless, nameless and formless“
Bhagavad Gita
1.Introduction
In the first chapter, I implemented Logistic Regression, in vectorized
Python, R and Octave, with a wannabe Neural Network (a Neural
Network with no hidden layers). In this second chapter, I implement a
regular, but somewhat primitive Neural Network, (a Neural Network
with just 1 hidden layer). This chapter implements classification of
manually created datasets, where the different clusters of the 2 classes
are not linearly separable.

Neural Network perform well in learning all sorts of non-linear


boundaries between classes. Initially logistic regression is used to
perform the classification. A simple 3-layer Neural Network is then
used on the same data set and the decision boundary plotted. Vanilla
logistic regression performs quite poorly. Using SVMs with a radial
basis kernel would have performed much better in creating non-linear
boundaries. The implementations of the functions invoked in this
chapter are in Appendix 2 - Implementing a simple Neural Network

You can clone and fork the vectorized implementations of the 3 layer
Neural Network for Python, R and Octave from Github at
DeepLearningFromFirstPrinciples
(https://github.com/tvganesh/DeepLearningFromFirstPrinciples/tree/master/Chap2
SimpleNeuralNetwork)
2.The 3 layer Neural Network
A simple representation of a 3 layer Neural Network (NN) with 1
hidden layer is shown below .

In the above Neural Network, there are two input features at the input
layer, three hidden units at the hidden layer and one output layer as it
deals with binary classification. The activation unit at the hidden layer
can be a tanh, sigmoid, relu etc. At the output layer, the activation is a
sigmoid to handle binary classification

# Superscript indicates layer ‘1’


Also

# Superscript indicates layer ‘2’

Hence

And

Similarly

and

These equations can be written as

I) Some important results (a memory refresher!)


and -(a) and
and

Using (a) we can shown that and


(b)
Now
-(c)
Since and using (c) we get

Using the values of the derivatives of sinhx and coshx from (b) above
we get

Since
-(d)

II) Derivatives
The log loss is given below

Since therefore see


equation (2) Chapter 1

Therefore and (e)


(f) and
and from (d)

(g)
(h)

III) Back propagation


Using the derivatives from II) we can derive the following results
using Chain Rule

(i)
Using the results of (i) and (e ) we get
-(j)
-(k)

And

Simplifying we get
-(l) and

-(m)

IV) Gradient Descent


The key computations in the backward cycle are based on the gradient
computed above in equations (h), (i),(j) and (k)

The weights and biases (W1,b1,W2,b2) are updated for each iteration
thus minimizing the loss/cost.

These derivations can be represented pictorially using the computation


graph (from the book Deep Learning
(http://www.deeplearningbook.org/) by Ian Goodfellow, Joshua
Bengio and Aaron Courville)
1.Manually create a data set that is not
linearly separable
Initially I create a dataset with 2 classes which has around 9 clusters
that cannot be separated by linear boundaries. Note: This data set is
also saved as data.csv and is used for the R and Octave Neural
networks to see how they perform on the same dataset.

import numpy as np
import matplotlib.pyplot as plt
import matplotlib.colors
import sklearn.linear_model

from sklearn.model_selection import train_test_split


from sklearn.datasets import make_classification, make_blobs
from matplotlib.colors import ListedColormap
import sklearn
import sklearn.datasets

colors=['black','gold']
cmap = matplotlib.colors.ListedColormap(colors)
X, y = make_blobs(n_samples = 400, n_features = 2, centers = 7,
cluster_std = 1.3, random_state = 4)

#Create 2 classes
y=y.reshape(400,1)
y=y%2

#Plot the figure


plt.figure()
plt.title('Non-linearly separable classes')
plt.scatter(X[:,0], X[:,1], c=y,
marker= 'o', s=50,cmap=cmap)
plt.savefig('fig1.png', bbox_inches='tight')
2.Logistic Regression
When classification with logistic regression is performed on the above
data set, and the decision boundary is plotted it can be seen that
logistic regression performs quite poorly

import numpy as np
import matplotlib.pyplot as plt
import matplotlib.colors
import sklearn.linear_model

from sklearn.model_selection import train_test_split


from sklearn.datasets import make_classification, make_blobs
from matplotlib.colors import ListedColormap
import sklearn
import sklearn.datasets

#from DLfunctions import plot_decision_boundary


execfile("./DLfunctions.py") # Since import does not work in Rmd!!!

colors=['black','gold']
cmap = matplotlib.colors.ListedColormap(colors)
X, y = make_blobs(n_samples = 400, n_features = 2, centers = 7,
cluster_std = 1.3, random_state = 4)

#Create 2 classes
y=y.reshape(400,1)
y=y%2

# Train the logistic regression classifier


clf = sklearn.linear_model.LogisticRegressionCV();
clf.fit(X, y);

# Plot the decision boundary for logistic regression


plot_decision_boundary_n(lambda x: clf.predict(x), X.T, y.T,"fig2.png")
5.1 The 3 layer Neural Network in Python (vectorized)
The vectorized implementation is included below. Note that in the
case of Python a learning rate of 0.5 and 3 hidden units performs very
well.

## Random data set with 9 clusters


import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import sklearn.linear_model
import pandas as pd

from sklearn.datasets import make_classification, make_blobs


execfile("./DLfunctions.py") # Since import does not work in Rmd!!!

X1, Y1 = make_blobs(n_samples = 400, n_features = 2, centers = 9,


cluster_std = 1.3, random_state = 4)
#Create 2 classes
Y1=Y1.reshape(400,1)
Y1 = Y1 % 2
X2=X1.T
Y2=Y1.T

# Execute the 3 layer Neural Network


parameters,costs = computeNN(X2, Y2, numHidden = 4, learningRate=0.5,
numIterations = 10000)

#Plot the decision boundary


plot_decision_boundary(lambda x: predict(parameters, x.T), X2,
Y2,str(4),str(0.5),"fig3.png")
## Cost after iteration 0: 0.692669
## Cost after iteration 1000: 0.246650
## Cost after iteration 2000: 0.227801
## Cost after iteration 3000: 0.226809
## Cost after iteration 4000: 0.226518
## Cost after iteration 5000: 0.226331
## Cost after iteration 6000: 0.226194
## Cost after iteration 7000: 0.226085
## Cost after iteration 8000: 0.225994
## Cost after iteration 9000: 0.225915
It can be seen the the 3 layer Neural Network with a single hidden
layer is able to create the non-linear boundary separating the classes
5.2 The 3 layer Neural Network in R (vectorized)
This the dataset created by Python was saved as data.csv. The R code
reads this data to see how R performs on the same dataset. The
vectorized implementation of a Neural Network in R, was just a little
more interesting as R does not have a similar package like ‘numpy’.
While numpy handles broadcasting implicitly, in R, I had to use the
‘sweep’ command to broadcast. The implementation is included
below. Note that since the initialization with random weights is
slightly different, R performs best with a learning rate of 0.1 and with
6 hidden units

source("DLfunctions2_1.R")
z <- as.matrix(read.csv("data.csv",header=FALSE)) #
x <- z[,1:2]
y <- z[,3]
x1 <- t(x)
y1 <- t(y)

# Execute the 3 layer Neural Network


nn <-computeNN(x1, y1, 6, learningRate=0.1,numIterations=10000) # Good
## [1] 0.7075341
## [1] 0.2606695
## [1] 0.2198039
## [1] 0.2091238
## [1] 0.211146
## [1] 0.2108461
## [1] 0.2105351
## [1] 0.210211
## [1] 0.2099104
## [1] 0.2096437
## [1] 0.209409
Other documents randomly have
different content
abandonment of the republican principle. This, always reposing on a
real or imaginary contract, distinguishes the nation, the successors
of the first community, from alien settlers, and, above all, from those
who are evidently of a different race. Length of time must, of
course, ingraft many of foreign origin upon the native tree; but to
throw open civil privileges at random to new-comers is to convert a
people into a casual aggregation of men. In a monarchy the
hereditary principle maintains an unity of the commonwealth; which,
though not entirely without danger, may better permit an equality of
privileges among all its subjects. Thus under Caracalla, but in a
period in which we should not look for good precedents, the great
name, as once it had been, of Roman citizen was extended, east and
west, to all the provinces of the empire.
[1092] Est civis nihil aliud quam liber homo, qui summa alterius potestate
obligatur.

Nature of 50. Bodin comes next to the relation between patron


sovereign and client, and to those alliances among states which
power.
bear an analogy to it. But he is careful to distinguish
patronage or protection from vassalage. Even in unequal alliances,
the inferior is still sovereign; and, if this be not reserved, the alliance
must become subjection.[1093] Sovereignty, of which he treats in the
following chapter, he defines a supreme and perpetual power,
absolute and subject to no law.[1094] A limited prince, except so far as
the limitation is confined to the laws of nature, is not sovereign. A
sovereign cannot bind his successor, nor can he be bound by his
own laws, unless confirmed by oath; for we must not confound the
laws and contracts of princes, the former depend upon his will, but
the latter oblige his conscience. It is convenient to call parliaments
or meetings of states-general for advice and consent, but the king is
not bound by them; the contrary notion has done much harm. Even
in England, where laws made in parliament cannot be repealed
without its consent, the king, as he conceives, does not hesitate to
dispose of them at his pleasure.[1095] And though no taxes are
imposed in England without consent of parliament, this is the case
also in other countries, if necessity does not prevent the meeting of
the states. He concludes, that the English parliament may have a
certain authority, but that the sovereignty and legislative power is
solely in the king. Whoever legislates is sovereign, for this power
includes all other. Whether a vassal or tributary prince is to be called
sovereign, is a question that leads Bodin into a great quantity of
feudal law and history; he determines it according to his own theory.
[1096]

[1093] c. 7.
[1094] Majestas est summa in cives ac subditos legibusque soluta postestas.
[1095] Hoc tamen singulare videri possit, quod, quæ leges populi rogatione
ac principis jussu feruntur, non aliter quam populi comitiis abrogari
possunt. Id enim Dellus Anglorum in Gallia legatus mihi confirmavit;
idem tamen confitetur legem probari aut respui consuevisse contra
populi voluntatem utcunque principi placuerit. He is evidently perplexed
by the case of England; and having been in this country before the
publication of his Latin edition, he might have satisfied himself on the
subject.
[1096] c. 9 and 10.

Forms of 51. The second book of the Republic treats of the


government. different species of civil government. These, according
to Bodin, are but three, no mixed form being possible, since
sovereignty or the legislative power is indivisible. A democracy he
defines to be a government where the majority of the citizens
possess the sovereignty. Rome he holds to have been a democratic
republic, in which, however, he is not exactly right; and he is
certainly mistaken in his general theory, by arguing as if the separate
definition of each of the three forms must be applicable after their
Despotism combination.[1097] In this chapter on despotic monarchy,
and he again denies that governments were founded on
monarchy.
original contract. The power of one man, in the origin of
political society, was absolute; and Aristotle was wrong in supposing
a fabulous golden age, in which kings were chosen by suffrage.[1098]
Despotism is distinguished from monarchy by the subjects being
truly slaves, without a right over their properties; but as the despot
may use them well, even this is not necessarily a tyranny.[1099]
Monarchy, on the other hand, is the rule of one man according to
the law of nature, who maintains the liberties and properties of
others as much as his own.[1100] As this definition does not imply any
other restraint than the will of the prince imposes on himself, Bodin
labours under the same difficulty as Montesquieu. Every English
reader of the Esprit des Loix has been struck by the want of a
precise distinction between despotism and monarchy. Tyranny
differs, Bodin says, from despotism, merely by the personal
character of the prince; but severity towards a seditious populace is
not tyranny; and here he censures the lax government of Henry II.
Tyrannicide he justifies in respect of an usurper who has no title
except force, but not as to lawful princes, or such as have become
so by prescription.[1101]
[1097] lib. ii. c. 1.
[1098] In the beginning of states, quo societas hominum coalescere cœpit, ac
reipublicæ forma quædam constitui, unius imperio ac dominatu omnia
tenebantur. Fallit enim Aristoteles, qui aureum illud genus hominum
fabulis poeticis quam reipsa illustrius, reges heroas suffragio creasse
prodidit; cum omnibus persuasum sit ac perspicuum monarchiam
omnium primam in Assyria fuisse constitutam Nimrodo principe, &c.
[1099] c. 2.
[1100] c. 3.
[1101] c. 4.

Aristocracy. 52. An aristocracy he conceives always to exist where a


smaller body of the citizens governs the greater.[1102] This definition,
which has been adopted by some late writers, appears to lead to
consequences hardly compatible with the common use of language.
The electors of the House of Commons in England are not a majority
of the people. Are they, therefore, an aristocratical body? The same
is still more strongly the case in France, and in most representative
governments of Europe. We might better say, that the distinguishing
characteristic of an aristocracy is the enjoyment of privileges, which
are not communicable to other citizens simply by anything they can
themselves do to obtain them. Thus no government would be
properly aristocratical where a pecuniary qualification is alone
sufficient to confer political power; nor did the ancients ever use the
word in such a sense. Yet the question might be asked, under what
category we would place the timocracy, or government of the rich.
[1102] Ego statum semper aristocraticum esse, judico, si minor pars civium
cæteris imperat. c. 1.

Senates and 53. Sovereignty resides in the supreme legislative


councils of authority; but this requires the aid of other inferior and
state.
delegated ministers, to the consideration of which the
third book of Bodin is directed. A senate he defines, “a lawful
assembly of counsellors of state, to give advice to them who have
the sovereignty in every commonwealth; we say, to give advice, that
we may not ascribe any power of command to such a senate.” A
council is necessary in a monarchy; for much knowledge is generally
mischievous in a king. It is rarely united with a good disposition, and
with a moral discipline of mind. None of the emperors were so
illiterate as Trajan, none more learned than Nero. The counsellors
should not be too numerous, and he advises that they should retain
their offices for life. It would be dangerous as well as ridiculous, to
choose young men for such a post, even if they could have wisdom
and experience, since neither older persons, nor those of their own
age, would place confidence in them. He then expatiates, in his
usual manner, upon all the councils that have existed in ancient or
modern states.[1103]
[1103] c. 1.

Duties of 54. A magistrate is an officer of the sovereign,


magistrates. possessing public authority.[1104] Bodin censures the
usual definitions of magistracy, distinguishing from magistrates both
those officers who possess no right of command, and such
commissioners as have only a temporary delegation. In treating of
the duty of magistrates towards the sovereign, he praises the rule of
the law of France, that the judge is not to regard private letters of
the king against the justice of a civil suit.[1105] But after stating the
doubt, whether this applies to matters affecting the public, he
concludes that the judge must obey any direction he receives, unless
contrary to the law of nature, in which case he is bound not to
forfeit his integrity. It is however better, as far as we can, to obey all
the commands of the sovereign, than to set a bad example of
resistance to the people. This has probably a regard to the frequent
opposition of the Parliament of Paris, to what it deemed the unjust
or illegal ordinances of the court. Several questions, discussed in
these chapters on magistracy, are rather subtle and verbal; and, in
general, the argumentative part of Bodin is almost drowned in his
erudition.
[1104] c. 3.
[1105] c. 4.

Corporations.55. A state cannot subsist without colleges and


corporations, for mutual affection and friendship is the necessary
bond of human life. It is true that mischiefs have sprung from these
institutions, and they are to be regulated by good laws; but as a
family is a community natural, so a college is a community civil, and
a commonwealth is but a community governed by a sovereign
power; and thus the word community is common unto all three.[1106]
In this chapter we have a full discussion of the subject; and,
adverting to the Spanish Cortes and English Commons as a sort of
colleges in the state, he praises them as useful institutions,
observing, with somewhat more boldness than is ordinary to him,
that in several provinces in France there had been assemblies of the
states, which had been abolished by those who feared to see their
own crimes and peculations brought to light.
[1106] c. 7.

56. In the last chapter of the third book, on the degrees


Slaves, part of
the state. and orders of citizens, Bodin seems to think that slaves,
being subjects, ought to be reckoned parts of the state.[1107] This is,
as has been intimated, in conformity with his monarchical notions.
He then enters upon the different modes of acquiring nobility, and
inveighs against making wealth a passport to it; discussing also the
derogation to nobility by plebeian occupation. The division into three
orders is useful in every form of government.
[1107] Si mihi tabellæ ac jura suffragiorum in hac disputatione tribuantur,
servos æque ac liberos homines civitate donari cupiam. By this he may
only mean that he would desire to emancipate them.

Rise and fall57. Perhaps the best chapter in the Republic of Bodin is
of states. the first in the fourth book, on the rise, progress,
stationary condition, revolutions, decline, and fall of states. A
commonwealth is said to be changed when its form of polity is
altered; for its identity is not to be determined by the long standing
of the city walls; but when popular government becomes monarchy,
or aristocracy is turned to democracy, the commonwealth is at an
end. He thus uses the word respublica in the sense of polity or
constitution, which is not, I think, correct, though sanctioned by
some degree of usage, and leaves his proposition a tautological
truism. The extinction of states may be natural or violent, but in one
way or the other it must happen, since there is a determinate period
to all things, and a natural season in which it seems desirable that
they should come to an end. The best revolution is that which takes
place by a voluntary cession of power.
Causes of 58. As the forms of government are three, it follows that
revolutions. the possible revolutions from one to another are six. For
anarchy is the extinction of a government, not a revolution in it. He
proceeds to develop the causes of revolutions with great extent of
historical learning and with judgment, if not with so much acuteness
or so much vigour of style as Machiavel. Great misfortunes in war, he
observes, have a tendency to change popular rule to aristocracy, and
success has an opposite effect; the same seems applicable to all
public adversity and prosperity. Democracy, however, more
commonly ends in monarchy, as monarchy does in democracy,
especially when it has become tyrannical; and such changes are
usually accompanied by civil war or tumult. Nor can aristocracy, he
thinks, be changed into democracy without violence, though the
converse revolution sometimes happens quietly, as when the
labouring classes and traders give up public affairs to look after their
own; in this manner Venice, Lucca, Ragusa, and other cities have
become aristocracies. The great danger for an aristocracy is, that
some ambitious person, either of their own body or of the people,
may arm the latter against them: and this is most likely to occur,
when honours and magistracy are conferred on unworthy men,
which affords the best topic to demagogues, especially where the
plebeians are wholly excluded: which, though always grievous to
them, is yet tolerable so long as power is intrusted to deserving
persons; but when bad men are promoted, it becomes easy to excite
the minds of the people against the nobility, above all, if there are
already factions among the latter, a condition dangerous to all
states, but mostly to an aristocracy. Revolutions are more frequent in
small states, because a small number of citizens is easily split into
parties; hence we shall find in one age more revolutions among the
cities of Greece or Italy than have taken place during many in the
kingdoms of France or Spain. He thinks the ostracism of dangerous
citizens itself dangerous, and recommends rather to put them to
death, or to render them friends. Monarchy, he observes, has this
peculiar to it, that if the king be a prisoner, the constitution is not
lost; whereas, if the seat of government in a republic be taken, it is
at an end, the subordinate cities never making resistance. It is
evident that this can only be applicable to the case, hitherto the
more common one, of a republic, in which the capital city entirely
predominates. “There is no kingdom which shall not, in continuance
of time, be changed, and at length also be overthrown. But it is best
for them who least feel their changes by little and little made,
whether from evil to good, or from good to evil.”
Astrological 59. If this is the best, the next is the worst chapter in
fancies of Bodin. It professes to inquire, whether the revolutions of
Bodin.
states can be foreseen. Here he considers, whether the
stars have such an influence on human affairs, that political changes
can be foretold by their means, and declares entirely against it, with
such expressions as would seem to indicate his disbelief in astrology.
If it were true, he says, that the conditions of commonwealths
depended on the heavenly bodies, there could be yet no certain
prediction of them; since the astrologers lay down their observations
with such inconsistency, that one will place the same star in direct
course at the moment that another makes it retrograde. It is obvious
that any one who could employ this argument, must have perceived
that it destroys the whole science of astrology. But, after giving
instances of the blunders and contradictions of these pretended
philosophers, he so far gives way as to admit that, if all the events
from the beginning of the world could be duly compared with the
planetary motions, some inferences might be deduced from them;
and thus giving up his better reason to the prejudices of his age, he
acknowledges astrology as a theoretical truth. The hypothesis of
Copernicus he mentions as too absurd to deserve refutation; since,
being contrary to the tenets of all theologians and philosophers and
to common sense, it subverts the foundations of every science. We
now plunge deeper into nonsense; Bodin proceeding to a long
arithmetical disquisition, founded on a passage in Plato, ascribing
the fall of states to want of proportion.[1108]
[1108] c. 2.

Danger of 60. The next chapter, on the danger of sudden


sudden revolutions in the entire government, asserts that even
changes.
the most determined astrologers agree in denying that a
wise man is subjugated by the starry influences, though they may
govern those who are led by passion like wild beasts. Therefore a
wise ruler may foresee revolutions and provide remedies. It is
doubtful whether an established law ought to be changed, though
not good in itself, lest it should bring others into contempt, especially
such as affect the form of polity. These, if possible, should be held
immutable; yet it is to be remembered, that laws are only made for
the sake of the community, and public safety is the supreme law of
laws. There is therefore no law so sacred that it may not be changed
through necessity. But, as a general rule, whatever change is to be
made should be effected gradually.[1109]
[1109] c. 3.

61. It is a disputed question whether magistrates should


Judicial power
of the be temporary or perpetual. Bodin thinks it essential that
sovereign.
the council of state should be permanent, but high civil
commands ought to be temporary.[1110] It is in general important that
magistrates shall accord in their opinions; yet there are
circumstances in which their emulation or jealousy may be beneficial
to a state.[1111] Whether the sovereign ought to exercise judicial
functions may seem, he says, no difficult question to those who are
agreed that kings were established for the sake of doing justice.
This, however, is not his theory of the origin of government; and
after giving all the reasons that can be urged in favour of a
monarch-judge, including as usual all historical precedents, he
decides that it is inexpedient for the ruler to pronounce the law
himself. His reasons are sufficiently bold, and grounded on an
intimate knowledge of the vices of courts, which he does not
hesitate to pour out.[1112]
[1110] c. 4.
[1111] c. 5.
[1112] c. 6.

Toleration of62. In treating of the part to be taken by the prince, or


religions. by a good citizen, in civil factions, after a long detail
from history of conspiracies and seditions, he comes to disputes
about religion, and contends against the permission of reasonings on
matters of faith. What can be more impious, he says, than to suffer
the eternal laws of God, which ought to be implanted in men’s minds
with the utmost certainty, to be called in question by probable
reasonings? For there is nothing so demonstrable, which men will
not undermine by argument. But the principles of religion do not
depend on demonstrations and arguments, but on faith alone; and
whoever attempts to prove them by a train of reasoning, tends to
subvert the foundations of the whole fabric. Bodin in this sophistry
was undoubtedly insincere. He goes on, however, having purposely
sacrificed this cock to Æsculapius, to contend that, if several
religions exist in a state, the prince should avoid violence and
persecution; the natural tendency of man being to give his assent
voluntarily, but never by force.[1113]
[1113] c. 7.

Influence of 63. The first chapter of the fifth book, on the adaptation
climate on of government to the varieties of race and climate, has
government.
excited more attention than most others, from its being
supposed to have given rise to a theory of Montesquieu. In fact,
however, the general principle is more ancient; but no one had
developed it so fully as Bodin. Of this he seems to be aware. No one,
he says, has hitherto treated on this important subject, which should
always be kept in mind, lest we establish institutions not suitable to
the people, forgetting that the laws of nature will not bend to the
fancy of man. He then investigates the peculiar characteristics of the
northern, middle, and southern nations, as to physical and moral
qualities. Some positions he has laid down erroneously; but, on the
whole, he shows a penetrating judgment and comprehensive
generalisation of views. He concludes that bodily strength prevails
towards the poles, mental power towards the tropics; and that the
nations lying between partake in a mixed ratio of both. This is not
very just; but he argues from the great armies that have come from
the north, while arts and sciences have been derived from the south.
There is certainly a considerable resemblance to Montesquieu in this
chapter; and like him, with better excuse, Bodin accumulates
inaccurate stories. Force prevails most with the northerns, reason
with the inhabitants of a temperate or middle climate, superstition
with the southerns; thus astrology, magic, and all mysterious
sciences have come from the Chaldeans and Egyptians. Mechanical
arts and inventions, on the other hand, flourish best in northern
countries, and the southerns hardly know how to imitate them, their
genius being wholly speculative, nor have they so much industry,
quickness in perceiving what is to be done, or worldly prudence. The
stars appear to exert some influence over national peculiarities; but
even in the same latitudes great variety of character is found, which
arises from a mountainous or level soil, and from other physical
circumstances. We learn by experience, that the inhabitants of hilly
countries and the northern nations generally love freedom, but
having less intellect than strength, submit readily to the wisest
among them. Even winds are not without some effect on national
character. But the barrenness or fertility of the soil is more
important; the latter producing indolence and effeminacy, while one
effect of a barren soil is to drive the people into cities, and to the
exercise of handicrafts for the sake of commerce, as we see at
Athens and Nuremburg, the former of which may be contrasted with
Bœotia.
64. Bodin concludes, after a profusion of evidence drawn from the
whole world, that it is necessary not only to consider the general
character of the climate as affecting an entire region, but even the
peculiarities of single districts, and to inquire what effects may be
wrought on the dispositions of the inhabitants by the air, the water,
the mountains and valleys, or prevalent winds, as well as those
which depend on their religion, their customs, their education, their
form of government; for whoever should conclude alike as to all who
live in the same climate would be frequently deceived; since, in the
same parallel of latitude, we may find remarkable differences even
of countenance and complexion. This chapter abounds with proofs
of the comprehension as well as patient research which distinguishes
Bodin from every political writer who had preceded him.
Means of 65. In the second chapter, which inquires how we may
obviating avoid the revolutions which an excessive inequality of
inequality.
possessions tends to produce, he inveighs against a
partition of property, as inconsistent with civil society, and against an
abolition of debts, because there can be no justice where contracts
are not held inviolable; and observes, that it is absurd to expect a
division of all possessions to bring about tranquillity. He objects also
to any endeavour to limit the number of the citizens, except by
colonisation. In deference to the authority of the Mosaic law, he is
friendly to a limited right of primogeniture, but disapproves the
power of testamentary dispositions, as tending to inequality, and the
admission of women to equal shares in the inheritance, lest the
same consequence should come through marriage. Usury he would
absolutely abolish, to save the poorer classes from ruin.
Confiscations66. Whether the property of condemned persons shall
—rewards. be confiscated is a problem, as to which, having given
the arguments on both sides, he inclines to a middle course, that the
criminal’s own acquisitions should be forfeited, but what has
descended from his ancestors should pass to his posterity. He speaks
with great freedom against unjust prosecutions, and points out the
dangers of the law of forfeiture.[1114] In the next, being the fourth
chapter of this book, he treats of rewards and punishments. All
states depend on the due distribution of these; but, while many
books are full of the latter, few have discussed the former, to which
he here confines himself. Triumphs, statues, public thanks, offices of
trust and command, are the most honourable; exemptions from
service or tribute, privileges, and the like, the most beneficial. In a
popular government, the former are more readily conceded than the
latter; in a monarchy, the reverse. The Roman triumph gave a
splendour to the republic itself. In modern times the sale of nobility,
and of public offices, renders them no longer so honourable as they
should be. He is here again very free-spoken as to the conduct of
the French, and of other governments.[1115]
[1114] c. 3.
[1115] c. 4.
Fortresses. 67. The advantage of warlike habits to a nation, and the
utility of fortresses, are then investigated. Some have objected to
the latter, as injurious to the courage of the people, and of little
service against an invader; and also, as furnishing opportunities to
tyrants and usurpers, or occasionally to rebels. Bodin, however,
inclines in their favour, especially as to those on the frontier, which
may be granted as feudal benefices, but not in inheritance. The
question of cultivating a military spirit in the people depends on the
form of polity: in popular states it is necessary; in an aristocracy,
unsafe. In monarchies, the position of the state with respect to its
neighbours is to be considered. The capital city ought to be strong in
a republic, because its occupation is apt to carry with it an entire
change in the commonwealth. But a citadel is dangerous in such a
state. It is better not to suffer castles, or strongholds of private men,
as is the policy of England; unless when the custom is so
established, that they cannot be dismantled without danger to the
state.[1116]
[1116] c. 5.

Necessity of 68. Treaties of peace and alliance come next under


good faith. review. He points out with his usual prolixity the
difference between equal and unequal compacts of this kind. Bodin
contends strongly for the rigorous maintenance of good faith, and
reprobates the civilians and canonists who induced the council of
Constance to break their promise towards John Huss. No one yet, he
exclaims, has been so consummately impudent, as to assert the
right of violating a fair promise; but one alleges the deceit of the
enemy; another, his own mistake; a third, the change of
circumstances, which has rendered it impossible to keep his word; a
fourth, the ruin of the state which it would entail. But no excuse,
according to Bodin, can be sufficient, save the unlawfulness of the
promise, or the impossibility of fulfilling it. The most difficult terms to
keep are between princes and their subjects, which generally require
the guarantee of other states. Faith, however, ought to be kept in
such cases; and he censures, though under an erroneous impression
of the fact, as a breach of engagement, the execution of the Duke of
York in the reign of Henry VI.; adding, that he prefers to select
foreign instances, rather than those at home, which he would wish
to be buried in everlasting oblivion. In this he probably alludes to the
day of St. Bartholomew.[1117]
[1117] c. 6. Externa libentius quam domestica recordor, quæ utinam
sempiterna oblivione sepulta jacerent.

Census of 69. The first chapter of the sixth book relates to a


property. periodical census of property, which he recommends as
too much neglected. The Roman censorship of manners he extols,
and thinks it peculiarly required, when all domestic coercion is come
to an end. But he would give no coercive jurisdiction to his censors,
and plainly intimates his dislike to a similar authority in the church.
Public [1118] A more important disquisition follows on public
revenues. revenues. These may be derived from seven sources:
namely, national domains; confiscation of enemies’ property; gifts of
friendly powers; tributes from dependent allies; foreign trade carried
on by the state; tolls and customs on exports and imports; or, lastly,
taxes directly levied on the people. The first of these is the most
secure and honourable; and here we have abundance of ancient and
modern learning, while of course the French principle of inalienability
is brought forward. The second source of revenue is justified by the
rights of war and practice of nations; the third has sometimes
occurred; and the fourth is very frequent. It is dishonourable for a
prince to be a merchant, and thus gain a revenue in the fifth mode,
yet the kings of Portugal do not disdain this; and the mischievous
usage of selling offices in some other countries seems to fall under
this head. The different taxes on merchandise, or, in our language,
of customs and excise, come in the sixth place. Here Bodin advises
to lower the import duties on articles with which the people cannot
well dispense, but to lay them heavily on manufactured goods, that
they may learn to practise these arts themselves.
[1118] lib. vi. c. 1.
Taxation. 70. The last species of revenue, obtained from direct
taxation, is never to be chosen but from necessity; and as taxes are
apt to be kept up when the necessity is passed, it is better that the
king should borrow money of subjects than impose taxes upon
them. He then enters on the history of taxation in different
countries, remarking it as peculiar to France, that the burthen is
thrown on the people to the ease of the nobles and clergy, which is
the case nowhere except with the French, among whom, as Cæsar
truly wrote, nothing is more despised than the common people.
Taxes on luxuries, which serve only to corrupt men, are the best of
all; those also are good which are imposed on proceedings at law, so
as to restrain unnecessary litigation. Borrowing at interest, or by way
of annuity, as they do at Venice, is ruinous. It seems, therefore, that
Bodin recommends loans without interest, which must be
compulsory. In the remainder of this chapter he treats of the best
mode of expending the public revenue, and advises that royal grants
should be closely examined, and, if excessive, be rescinded, at least
after the death of the reigning king.[1119]
[1119] c. 2.

Adulteration 71. Every adulteration of coin, to which Bodin proceeds,


of coin. and every change in its value is dangerous, as it affects
the certainty of contracts, and renders every man’s property
insecure. The different modes of alloying coin are then explained
according to practical metallurgy, and, assuming the constant ratio
of gold to silver as twelve to one, he advises that coins of both
metals should be of the same weight. The alloy should not be above
one in twenty-four; and the same standard should be used for plate.
Many curious facts in monetary history will be found collected in this
chapter.[1120]
[1120] c. 3.

72. Bodin next states fully and with apparent fairness,


Superiority of
monarchy. the advantages and disadvantages both of democracy
and aristocracy, and, admitting that some evils belong to monarchy,
contends that they are all much less than in the two other forms. It
must be remembered, that he does not acknowledge the possibility
of a mixed government; a singular error, which, of course, vitiates
his reasonings in this chapter. But it contains many excellent
observations on democratical violence and ignorance, which history
had led him duly to appreciate.[1121] The best form of polity, he holds
to be a monarchy by agnatic succession, such as, in contradiction to
Hottoman, he maintained to have been always established in France,
pointing out also the mischiefs that have ensued in other countries
for want of a Salic law.[1122]
[1121] c. 4.
[1122] c. 5.

Conclusion of73. In the concluding chapter of the work, Bodin, with


the work. too much parade of mathematical language, descants on
what he calls arithmetical, geometrical, and harmonic proportions, as
applied to political regimen. As the substance of all this appears only
to be, that laws ought sometimes to be made according to the
circumstances and conditions of different ranks in society, sometimes
to be absolutely equal, it will probably be thought by most rather
incumbered by this philosophy, which, however, he borrowed from
the ancients, and found conformable to the spirit of learned men in
his own time. Several interesting questions in the theory of
jurisprudence are incidentally discussed in this chapter, such as that
of the due limits of judicial discretion.
Bodin 74. It must appear, even from this imperfect analysis, in
compared which much has been curtailed of its fair proportion, and
with Aristotle
and many both curious and judicious observations omitted,
Machiavel. that Bodin possessed a highly philosophical mind, united
with the most ample stores of history and jurisprudence. No former
writer on political philosophy had been either so comprehensive in
his scheme, or so copious in his knowledge; none, perhaps, more
original, more independent and fearless in his inquiries. Two names
alone, indeed, could be compared with his: Aristotle and Machiavel.
Without, however, pretending that Bodin was equal to the former in
acuteness and sagacity, we may say that the experience of two
thousand years, and the maxims of reason and justice, suggested or
corrected by the gospel and its ministers, by the philosophers of
Greece and Rome, and by the civil law, gave him advantages, of
which his judgment and industry fully enabled him to avail himself.
Machiavel, again, has discussed so few, comparatively, of the
important questions in political theory, and has seen many things so
partially, according to the narrow experience of Italian republics,
that, with all his superiority in genius, and still more in effective
eloquence, we can hardly say that his Discourses on Livy are a more
useful study than the Republic of Bodin.
And with 75. It has been often alleged, as we have mentioned
Montesquieu.above, that Montesquieu owed something, and
especially his theory of the influence of climate, to Bodin. But,
though he had unquestionably read the Republic with that
advantage which the most fertile minds derive from others, this
ought not to detract in our eyes from his real originality. The
Republic, and the Spirit of Laws bear, however, a more close
comparison than any other political systems of celebrity. Bodin and
Montesquieu are, in this province of political theory, the most
philosophical of those who have read so deeply, the most learned of
those who have thought so much. Both acute, ingenious, little
respecting authority in matters of opinion, but deferring to it in
established power, and hence apt to praise the fountain of waters
whose bitterness they exposed; both in advance of their age, but
one so much that his genius neither kindled a fire in the public mind,
nor gained its own due praise, the other more fortunate in being the
immediate herald of a generation which he stimulated, and which
repaid him by its admiration; both conversant with ancient and
mediæval history, and with the Roman as well as national law; both
just, benevolent, and sensible of the great object of civil society, but
displaying this with some variation according to their times; both
sometimes seduced by false analogies, but the one rather through
respect to an erroneous philosophy, the other through personal thirst
of praise and affectation of originality; both aware that the basis of
the philosophy of man is to be laid in the records of his past
existence; but the one prone to accumulate historical examples
without sufficient discrimination, and to overwhelm, instead of
convincing the reader by their redundancy, the other aiming at an
induction from select experience, but hence appearing sometimes to
reason generally from particular premises, or dazzling the student by
a proof that does not satisfy his reason.[1123]
[1123] This account of Bodin’s Republic will be found too long by many
readers; and I ought, perhaps, to apologise for it on the score that M.
Lerminier, in his brilliant and agreeable Introduction à l’Histoire
Generale du Droit (Paris, 1829), has pre-occupied the same ground.
This, however, had escaped my recollection (though I was acquainted
with the work of M. L.) when I made my own analysis, which has not
been borrowed in a single line from his. The labours of M. Lerminier
are not so commonly known in England as to render it unnecessary to
do justice to a great French writer of the sixteenth century.
As I have mentioned M. Lerminier, I would ask whether the following is
a fair translation of the Latin of Bodin:—Eo nos ipsa ratio deducit,
imperia scilicet ac respublicas vi primum coaluisse, etiam si ab historia
deseramur; quamquam pleni sunt libri, plenæ leges, plena antiquitas.
En établissant la théorie de l’origine des sociétés, il declare qu’il y
persiste, quand même les faits iraient à l’encontre. Hist. du Droit. p. 62
and 67.

Sect. III.—On Jurisprudence.


Golden Age of Jurisprudence—Cujacius—Other Civilians—Anti-
Tribonianus of Hottoman—Law of Nations—Franciscus a Victoria—
Balthazar Ayala—Albericus Gentilis.
76. The latter part of the sixteenth century, denominated
Golden age of
jurisprudence.
by Andrès the golden age of jurisprudence, produced
the men who completed what Alciat and Augustinus had begun in
the preceding generation, by elucidating and reducing to order the
dark chaos which the Roman law, enveloped in its own obscurities
and those of its earlier commentators, had presented to the student.
Cujacius. The most distinguished of these, Cujacius, became
professor at Bourges, the chief scene of his renown, and the
principal seminary of the Roman law in France, about the year 1555.
His works, of which many had been separately published, were
collected in 1577, and they make an epoch in the annals of
jurisprudence. This greatest of all civil lawyers pursued the track that
Alciat had so successfully opened, avoiding all scholastic subtleties of
interpretation, for which he substituted a general erudition that
rendered the science at once more intelligible and more attractive.
Though his works are voluminous, Cujacius has not the reputation of
diffuseness; on the contrary, the art of lucid explanation with brevity
is said to have been one of his great characteristics. Thus, in the
Paratitla on the Digest, a little book which Hottoman, his rival and
enemy, advised his own son to carry constantly about with him, we
find a brief exposition, in very good Latin, of every title in order, but
with little additional matter. And it is said that he thought nothing
requisite for the Institutes but short clear notes, which his thorough
admirers afterwards contrasted with the celebrated but rather
verbose commentaries of Vinnius.
Eulogies 77. Notwithstanding this conciseness, his works extend
bestowed to a formidable length. For the civil law itself is, for the
upon him.
most part, very concisely written, and stretches to such
an extent, that his indefatigable diligence in illustrating every portion
of it could not be satisfied within narrow bounds. “Had Cujacius
been born sooner,” in the words of the most elegant of his
successors, “he would have sufficed instead of every other
interpreter. For neither does he permit us to remain ignorant of
anything, nor to know anything which he has not taught. He alone
instructs us on every subject, and what he teaches is always his
own. Hence, though the learned style of jurisprudence began with
Alciat, we shall call it Cujacian.”[1124] “Though the writings of Cujacius
are so voluminous,” says Heineccius, “that scarce any one seems
likely to read them all, it is almost peculiar to him, that the longer
any of his books is, the more it is esteemed. Nothing in them is
trivial, nothing such as might be found in any other; everything so
well chosen that the reader can feel no satiety; and the truth is seen
of what he answered to his disciples, when they asked for more
diffuse commentaries, that his lectures were for the ignorant, his
writings for the learned.”[1125] A later writer, Gennari, has given a
more fully elaborate character of this illustrious lawyer, who might
seem to have united every excellence without a failing.[1126] But
without listening to the enemies whom his own eminence, or the
polemical fierceness of some disputes in which he was engaged,
created among the jurists of that age, it has since been observed,
that in his writings may be detected some inconsistencies, of which
whole books have been invidiously compiled, and that he was too
prone to abuse his acuteness by conjectural emendations of the
text; a dangerous practice, as Bynkershoek truly remarks, when it
may depend upon a single particle whether the claim of Titius or of
Marius shall prevail.[1127]
[1124] Gravina, Origines, Juris Civilis, p. 219.
[1125] Heineccii Opera xiv. 203. He prefers the Observationes atque
Emendationes of Cujacius to all his other works. These contain twenty-
eight books, published, at intervals, from the year 1556. They were
designed to extend to forty books.
[1126] Respublica Jurisconsultorum, p. 237. Intactum in jurisprudentia reliquit
nihil, et quæ scribit, non tam ex aliis excerpta, quam a se inventa, sane
fatentur omnes; ita omnia suo loco posita, non nimis protracta, quæ
nauseam creant, non arcte ac jejune tractata, quæ explicationis paullo
diffusioris pariunt desiderium. Candida perspicuitate brevis, elegans sub
amabili simplicitate, caute eruditus, quantum patitur occasio, ubique
docens, ne aliqua parte arguatur otiosus, tam nihil habet inane, nihil
inconditum, nihil curtum, nihil claudicans, nihil redundans, amœnus in
Observationibus, subtilis in Tractatibus, uber ac planus in
Commentariis, generosus in refellendis objectis, accuratus in
confingendis notis, in Paratitlis brevis ac succi plenus, rectus
prudensque in Consultationibus.
[1127] Heinecc. xiv. 209. Gennari, p. 199.

Cujacius, an 78. Such was the renown of Cujacius that, in the public
interpreter of schools of Germany, when his name was mentioned,
law rather
than a lawyer. every one took off his hat.[1128] The continual bickerings
of his contemporaries, not only of the old Accursian school, among
whom Albericus Gentilis was prominent in disparaging him, but of
those who had been trained in the steps of Alciat like himself, did
not affect this honest admiration of the general student.[1129] But we
must not consider Cujacius exactly in the light of what we now call a
great lawyer. He rejected all modern forensic experience with scorn,
declaring that he had misspent his youth in such studies. We have,
indeed, fifty of his consultations which appear to be actual cases.
But, in general, it is observed by Gravina that both he and the
greatest of his disciples “are but ministers of ancient jurisprudence,
hardly deigning to notice the emergent questions of modern
practice. Hence, while the elder jurists of the school of Bartolus,
deficient as they are in expounding the Roman laws, yet apply them
judiciously to new cases, these excellent interpreters hardly regard
anything modern, and leave to the others the whole honour of
advising and deciding rightly.” Therefore he recommends that the
student who has imbibed the elements of Roman jurisprudence in all
their purity from the school of Cujacius, should not neglect the
interpretations of Accursius in obscure passages; and, above all,
should have recourse to Bartolus and his disciples for the arguments,
authorities, and illustrations which ordinary forensic questions will
require.[1130]
[1128] Gennari, p. 246. Biogr. Univ.
[1129] Heineccius, ibid. Gennari, p. 242.
[1130] Gravina, p. 222, 230.

French 79. At some distance below Cujacius, but in places of


lawyers below honour, we find among the great French interpreters of
Cujacius;
Govea and the civil law in this age, Duaren, as devoted to ancient
others. learning as Cujacius, but differing from him by
inculcating the necessity of forensic practice to form a perfect
lawyer;[1131] Govea, who, though a Portuguese, was always resident
in France, whom some have set even above Cujacius for ability, and
of whom it has been said that he is the only jurist who ought to
have written more;[1132] Brisson, a man of various learning, who
became in the seditions of Paris an unfortunate victim of his own
weak ambition; Balduin, a strenuous advocate for uniting the study
of ancient history with that of law; Godefroi, whose Corpus Juris
Civilis makes an epoch in jurisprudence, being the text-book
universally received; and Connan, who is at least much quoted by
the principal writers on the law of nature and nations. The boast of
Germany was Gifanius.
[1131] Duarenus ... sine forensis exercitationis præsidio nec satis percipi, nec
recte commodeque doceri jus civile existimate. Gennari, p. 179.
[1132] Goveanus ... vir, de quo uno desideretur, plura scripsisse, de cæteris
vero, pauciora.... quia felix ingenio, naturæ viribus tantum confideret,
ut diligentiæ laudem sibi non necessariam, minus etiam honorificam
putare videatur. Gennari, p. 281.

Opponents of 80. These “ministers of ancient jurisprudence” seemed


the Roman to have no other office than to display the excellences of
law.
the old masters in their original purity. Ulpian and
Papinian were to them what Aristotle and Aquinas were to another
class of worshippers. But the jurists of the age of Severus have
come down to us through a compilation in that of Justinian; and
Alciat himself had begun to discover the interpolations of Tribonian,
and the corruption which, through ignorance or design, had
penetrated the vast reservoir of the Pandects. Augustinus, Cujacius,
and other French lawyers of the school of Bourges followed in this
track, and endeavoured not only to restore the text from errors
introduced by the carelessness of transcribers, a necessary and
arduous labour, but from those springing out of the
presumptuousness of the lawgiver himself, or of those whom he had
employed. This excited a vehement opposition, led by some of the
chief lawyers of France, jealous of the fame of Cujacius. But while
they pretended to rescue the orthodox vulgate from the innovations
of its great interpreter, another sect rose up, far bolder than either,
which assailed the law itself. Of these the most determined were
Faber and Hottoman.
Faber of 81. Antony Faber, or Fabre, a lawyer of Savoy, who
Savoy. became president of the court of Chamberi in 1610,
acquired his reputation in the sixteenth century. He waged war
against the whole body of commentators, and even treated the civil
law itself as so mutilated and corrupt, so inapplicable to modern
times, that it would be better to lay it altogether aside. Gennari says,
that he would have been the greatest of lawyers, if he had not been
too desirous to appear such;[1133] his temerity and self-confidence
diminished the effect of his ability. His mind was ardent and
unappalled by difficulties; no one had more enlarged views of
jurisprudence, but in his interpretations he was prone to make the
laws rather what they ought to have been than what they were. His
love of paradox is hardly a greater fault than the perpetual carping
at his own master Cujacius, as if he thought the reform of
jurisprudence should have been reserved for himself.[1134]
[1133] P. 97.
[1134] Heineccius, p. 236. Fabre, says Ferriere, as quoted by Terrasson, Hist.
de la Jurisprudence, est celui des jurisconsultes modernes qui a porté
le plus loin les idées sur le droit. C’etoit un esprit vaste que ne se
rebutoit par de plus grandes difficultés. Mais on l’accuse avec raison
d’avoir decidé un peu trop hardiment contre les opinions communes, et
de s’être donné souvent trop de liberté de retrancher ou d’ajouter dans
les loix. See too the article Favre, in Biographie Universelle.

Anti- 82. But the most celebrated production of this party is


Tribonianus of
the Anti-Tribonianus of Hottoman. This was written in
Hottoman.
1567, and though not published in French till 1609, nor
in the original till 1647, seems properly to belong to the sixteenth
century. He begins by acknowledging the merit of the Romans in
jurisprudence, but denies that the compilation of Justinian is to be
confounded with the Roman law. He divides his inquiry into two
questions: first, whether the study of these laws is useful in France;
and secondly, what are their deficiencies. These laws, he observes
by the way, contain very little instruction about Roman history or
antiquities, so that in books on those subjects we rarely find them
cited. He then adverts to particular branches of the civil law, and
shows that numberless doctrines are now obsolete, such as the state
of servitude, the right of arrogation, the ceremonies of marriage, the
peculiar law of guardianship, while for matters of daily occurrence
they give us no assistance. He points out the useless distinctions
between things mancipi and non mancipi, between the dominium
quiritarium and bonitarium; the modes of acquiring property by
mancipation, cessio in jure, usucapio, and the like, the unprofitable
doctrines about fidei commissa and the jus accrescendi. He dwells
on the folly of keeping up the old forms of stipulation in contracts,
and those of legal process, from which no one can depart a syllable
without losing his suit. And on the whole he concludes, that not a
twentieth part of the Roman law survives, and of that not one tenth
can be of any utility. In the second part, Hottoman attacks Tribonian
himself, for suppressing the genuine works of great lawyers, for
barbarous language, for perpetually mutilating, transposing and
interpolating the passages which he inserts, so that no cohesion or
consistency is to be found in these fragments of materials, nor is it
possible to restore them. The evil has been increased by the herd of
commentators and interpreters since the twelfth century; those who
have lately appeared and applied more erudition rarely agreeing in
their conjectural emendations of the text, which yet frequently varies
in different manuscripts, so as to give rise to endless disputes. He
ends by recommending that some jurisconsults and advocates
should be called together, in order to compile a good code of laws;
taking whatever is valuable in the Roman system, and adding
whatever from other sources may seem worthy of reception,
drawing them up in plain language, without too much subtlety, and
attending chiefly to the principles of equity. He thinks that a year or
two would suffice for the instruction of students in such a code of
laws, which would be completed afterwards, as was the case at
Rome, by forensic practice.
83. These opinions of Hottoman, so reasonable in
Civil law not
countenancedthemselves, as to the inapplicability of much of the
in France.
Roman law to the actual state of society, were congenial
to the prejudices of many lawyers in France. That law had in fact to
Welcome to our website – the perfect destination for book lovers and
knowledge seekers. We believe that every book holds a new world,
offering opportunities for learning, discovery, and personal growth.
That’s why we are dedicated to bringing you a diverse collection of
books, ranging from classic literature and specialized publications to
self-development guides and children's books.

More than just a book-buying platform, we strive to be a bridge


connecting you with timeless cultural and intellectual values. With an
elegant, user-friendly interface and a smart search system, you can
quickly find the books that best suit your interests. Additionally,
our special promotions and home delivery services help you save time
and fully enjoy the joy of reading.

Join us on a journey of knowledge exploration, passion nurturing, and


personal growth every day!

ebookbell.com

You might also like