Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - charles

Pages: [1]
1
Uncertainty Quantification (quoFEM) / Local Failure Setting up Dakota
« on: November 16, 2022, 08:44:49 PM »
Hello,

I tried to run my data on designsafe, but got this error...
problems with the setup?

Thanks.

2
can't find it anymore...

3
Spatial Uncertainty Research Framework (SURF) / An example
« on: August 06, 2020, 05:23:27 AM »
In the document there is an example showing how to use SURF to learn the pattern in a dataset, and use the learned knowledge to enhance the original dataset.

The example codes are as follows, but you can also run it in Golab notebook: [https://colab.research.google.com/github/NHERI-SimCenter/SURF/blob/master/examples/demo-NN.ipynb]

Code: [Select]
import os
import wget
import zipfile
import shutil
import csv
import numpy as np

import matplotlib.cm as cm
import matplotlib.pyplot as plt
import matplotlib.colors as colors

#---------------------------------------------------------------------------------------
# 0. Download data
#---------------------------------------------------------------------------------------

url = 'https://berkeley.box.com/shared/static/jbvyu0ng0zrt75il3ps1qygwellpr8c5.zip'
workDir = 'tmp'
fileName = 'AnchorageBuildings.zip'
print('Beginning file download with wget module')
wget.download(url, fileName)
print('\nFile downloaded. \n')

with zipfile.ZipFile(fileName, 'r') as zip_ref:
    zip_ref.extractall('tmp')

try:
    dest = shutil.move(fileName, workDir+'/')
except:
    os.remove(workDir+'/'+fileName)
    dest = shutil.move(fileName, workDir+'/')


#---------------------------------------------------------------------------------------
# 1. Prepare data
#---------------------------------------------------------------------------------------

BIMFileName = 'tmp/AnchorageBuildings.csv'

# read raw data
data = []
with open(BIMFileName, newline='') as csvfile:
    reader = csv.DictReader(csvfile)
    for row in reader:
        lat = float(row['Latitude'])
        lon = float(row['Longitude'])
        yearbuilt = int(float(row['Year Built']) )
        if lat>61.05 and lat<61.2 and lon>-150. and lon<-149.7:
            data.append([lon, lat, yearbuilt])

# data is a numpy matrix with columns: [x,y,value]
data = np.array(data)


#---------------------------------------------------------------------------------------
# 2. Train a neural network
#---------------------------------------------------------------------------------------
from surf.NN import SpatialNeuralNet


# define a spatial neural network
# numNei is the number of nearest neighbors to be considered
# writeTmpData is true so that temporary files are written down in ./tmp
nn = SpatialNeuralNet(rawData = data, numNei = 2, writeTmpData=True)
nn.build_model()
nn.train()


#---------------------------------------------------------------------------------------
# 3. Test the neural network
#---------------------------------------------------------------------------------------

nn.test()


4
Dear users, Welcome!

If you have any question about SURF, please click "NEW TOPIC" and create a new post.
I'll receive your question timely.

You can include files, images in your post by clicking "Attachments and other options".

Have fun! :) :)  ;)

5
We recently released a building inventory dataset generated by BRAILS.

It is formatted in HAZUS style and can be found in this link: https://github.com/NHERI-SimCenter/BRAILS/tree/master/docs/datarelease


6
Dear users, Welcome!

If you have any question about BRAILS, please click "NEW TOPIC" and create a new post.
I'll receive your question timely.

You can include files, images in your post by clicking "Attachments and other options".

Have fun! :) :) :)

7
You can always export your analysis configuration and share it with others so that they can repeat your analysis!

To export:
Go to menu and click "File", then click "Save as", then select a local location where you'll save the configuration file.
Give it a name (for example, analysis.json), then click "Save".

Now you can share it with people!   ;D




8
Site Response Analysis (s3hark) / Welcome to s3hark message board!
« on: March 04, 2020, 09:54:31 PM »
Dear users, Welcome!

If you have any question about s3hark (and other things), please click "NEW TOPIC" and create a new post.
I'll receive your question timely.

You can include files, images in your post by clicking "Attachments and other options".

Have fun!

 :) ;) :D ;D

Pages: [1]